(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.CodeMirror=t()})(this,function(){'use strict';function e(e){return new RegExp('(^|\\s)'+e+'(?:$|\\s)\\s*')}function t(t){for(var e=t.childNodes.length;0n||n>=t)return i+(t-s);i+=n-s,i+=o-i%o,s=n+1}}function h(e,t){for(var n=0;n=t)return o+vi(i,t-r);if(r+=a-o,r+=n-r%n,o=a+1,r>=t)return o}}function g(e){for(;Zi.length<=e;)Zi.push(f(Zi)+' ');return Zi[e]}function f(e){return e[e.length-1]}function y(e,t){for(var n=[],o=0;on?0n?-1:1;;){if(t==n)return t;var r=(t+n)/2,a=0>o?bi(r):yi(r);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+o}}function I(e,t,n){var a=this;this.input=n,a.scrollbarFiller=o('div',null,'CodeMirror-scrollbar-filler'),a.scrollbarFiller.setAttribute('cm-not-content','true'),a.gutterFiller=o('div',null,'CodeMirror-gutter-filler'),a.gutterFiller.setAttribute('cm-not-content','true'),a.lineDiv=r('div',null,'CodeMirror-code'),a.selectionDiv=o('div',null,null,'position: relative; z-index: 1'),a.cursorDiv=o('div',null,'CodeMirror-cursors'),a.measure=o('div',null,'CodeMirror-measure'),a.lineMeasure=o('div',null,'CodeMirror-measure'),a.lineSpace=r('div',[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,'position: relative; outline: none');var i=r('div',[a.lineSpace],'CodeMirror-lines');a.mover=o('div',[i],null,'position: relative'),a.sizer=o('div',[a.mover],'CodeMirror-sizer'),a.sizerWidth=null,a.heightForcer=o('div',null,null,'position: absolute; height: '+Xi+'px; width: 1px;'),a.gutters=o('div',null,'CodeMirror-gutters'),a.lineGutter=null,a.scroller=o('div',[a.sizer,a.heightForcer,a.gutters],'CodeMirror-scroll'),a.scroller.setAttribute('tabIndex','-1'),a.wrapper=o('div',[a.scrollbarFiller,a.gutterFiller,a.scroller],'CodeMirror'),wi&&8>Ii&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),Ni||Si&&Fi||(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,n.init(a)}function N(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error('There is no line '+(t+e.first)+' in the document.');for(var n=e;!n.lines;)for(var o=0;;++o){var r=n.children[o],a=r.chunkSize();if(t=e.first&&tF(e,t)?t:e}function W(e,t){return 0>F(e,t)?e:t}function H(e,t){return fi(e.first,vi(t,e.first+e.size-1))}function q(e,t){if(t.linen?M(n,N(e,n).text.length):j(t,N(e,t.line).text.length)}function j(e,t){var n=e.ch;return null==n||n>t?M(e.line,t):0>n?M(e.line,0):e}function z(e,t){for(var n=[],o=0;o=t:a.to>t);(o||(o=[])).push(new X(i,a.from,d?null:a.to))}}return o}function Z(e,t,n){var o;if(e)for(var r=0;r=t:a.to>t);if(s||a.from==t&&'bookmark'==i.type&&(!n||a.marker.insertLeft)){var d=null==a.from||(i.inclusiveLeft?a.from<=t:a.fromF(l.to,s.from)||0c)&&(i.inclusiveLeft||c)||p.push({from:l.from,to:s.from}),!(0de(o,r.marker))&&(o=r.marker);return o}function pe(e){return le(e,!0)}function ce(e){return le(e,!1)}function ue(e,t,n,o,r){var a=N(e,t),s=os&&a.markedSpans;if(s)for(var d=0,i;d=c||0>=p&&0<=c)&&(0>=p&&(i.marker.inclusiveRight&&r.inclusiveLeft?0<=F(l.to,n):0=F(l.from,o):0>F(l.from,o))))return!0}}function he(e){for(var t;t=pe(e);)e=t.find(-1,!0).line;return e}function me(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function ge(e){for(var t,n;t=ce(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function fe(e,t){var n=N(e,t),o=he(n);return n==o?t:O(o)}function ye(e,t){if(t>e.lastLine())return t;var n=N(e,t),o;if(!be(e,n))return t;for(;o=ce(n);)n=o.find(1,!0).line;return O(n)+1}function be(e,t){var n=os&&t.markedSpans;if(n)for(var o=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function Ee(e,t,n,o){if(!e)return o(t,n,'ltr',0);for(var r=!1,a=0,i;at||t==n&&i.to==t)&&(o(fi(i.from,t),vi(i.to,n),1==i.level?'rtl':'ltr',a),r=!0);r||o(t,n,'ltr')}function ke(e,t,n){var o;rs=null;for(var r=0,a;rt)return r;a.to==t&&(a.from!=a.to&&'before'==n?o=r:rs=r),a.from==t&&(a.from!=a.to&&'before'!=n?o=r:rs=r)}return null==o?rs:o}function Te(e,t){var n=e.order;return null==n&&(n=e.order=as(e.text,t)),n}function we(e,t){return e._handlers&&e._handlers[t]||is}function Ie(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent('on'+t,n);else{var o=e._handlers,r=o&&o[t];if(r){var a=h(r,n);-1=t.offsetWidth&&2Ii))}var r=fs?o('span','\u200B'):o('span','\xA0',null,'display: inline-block; width: 1px; margin-right: -1px');return r.setAttribute('cm-text',''),r}function Ve(e){if(null!=ys)return ys;var o=n(e,document.createTextNode('A\u062EA')),r=zi(o,0,1).getBoundingClientRect(),a=zi(o,1,2).getBoundingClientRect();return t(e),r&&r.left!=r.right&&(ys=3>a.right-r.right)}function We(e){if(null!=cs)return cs;var t=n(e,o('span','x')),r=t.getBoundingClientRect(),a=zi(t,0,1).getBoundingClientRect();return cs=1e&&a.splice(l,1,e,a[l+1],r),l+=2,i=vi(e,r);if(t)if(o.opaque)a.splice(n,l-n,e,'overlay '+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ke(e.doc.mode,o.state),a=Qe(e,t,o);r&&(o.state=r),t.stateAfter=o.save(!r),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=fi(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Je(e,t,n){var o=e.doc,r=e.display;if(!o.mode.startState)return new vs(o,!0,t);var a=rt(e,t,n),i=a>o.first&&N(o,a-1).stateAfter,s=i?vs.fromSaved(o,i,a):new vs(o,Xe(o.mode),a);return o.iter(a,t,function(n){$e(e,n.text,s);var o=s.line;n.stateAfter=o==t-1||0==o%5||o>=r.viewFrom&&or;r++){o&&(o[0]=Ge(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error('Mode '+e.name+' failed to advance stream.')}function tt(e,t,n,o){var r=e.doc,a=r.mode,i;t=q(r,t);var s=N(r,t.line),d=Je(e,t.line,n),l=new gs(s.text,e.options.tabSize,d),p;for(o&&(p=[]);(o||l.pose.options.maxHighlightLength?(s=!1,i&&$e(e,t,o,p.pos),p.pos=t.length,u=null):u=nt(et(n,p,o.state,c),a),c){var h=c[0].name;h&&(u='m-'+(u?h+' '+u:h))}if(!s||l!=u){for(;dr;--a){if(a<=o.first)return o.first;var d=N(o,a-1),l=d.stateAfter;if(l&&(!n||a+(l instanceof bs?l.lookAhead:0)<=o.modeFrontier))return a;var p=u(d.text,null,e.options.tabSize);(null==s||i>p)&&(s=a-1,i=p)}return s}function at(e,t){if(e.modeFrontier=vi(e.modeFrontier,t),!(e.highlightFrontiern;o--)if(r=N(e,o).stateAfter,r&&(!(r instanceof bs)||o+r.lookAheadIi&&(p=!0),e.pos+=t.length;else{c=document.createDocumentFragment();for(var u=0;;){l.lastIndex=u;var h=l.exec(t),f=h?h.index-u:t.length-u;if(f){var y=document.createTextNode(d.slice(u,u+f));wi&&9>Ii?c.appendChild(o('span',[y])):c.appendChild(y),e.map.push(e.pos,e.pos+f,y),e.col+=f,e.pos+=f}if(!h)break;u+=f+1;var b=void 0;if('\t'==h[0]){var v=e.cm.options.tabSize,x=v-e.col%v;b=c.appendChild(o('span',g(x),'cm-tab')),b.setAttribute('role','presentation'),b.setAttribute('cm-text','\t'),e.col+=x}else'\r'==h[0]||'\n'==h[0]?(b=c.appendChild(o('span','\r'==h[0]?'\u240D':'\u2424','cm-invalidchar')),b.setAttribute('cm-text',h[0]),e.col+=1):(b=e.cm.options.specialCharPlaceholder(h[0]),b.setAttribute('cm-text',h[0]),wi&&9>Ii?c.appendChild(o('span',[b])):c.appendChild(b),e.col+=1);e.map.push(e.pos,e.pos+1,b),e.pos++}}if(e.trailingSpace=32==d.charCodeAt(t.length-1),n||r||a||p||s){var C=n||'';r&&(C+=r),a&&(C+=a);var S=o('span',[c],C,s);return i&&(S.title=i),e.content.appendChild(S)}e.content.appendChild(c)}}function ut(e,t){if(1p&&u.from<=p));h++);if(u.to>=c)return e(n,o,r,a,s,d,l);e(n,o.slice(0,u.to-p),r,a,null,d,l),a=null,o=o.slice(u.to-p),p=u.to}}}function mt(e,t,n,o){var r=!o&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!o&&e.cm.display.input.needsContentAttribute&&(!r&&(r=e.content.appendChild(document.createElement('span'))),r.setAttribute('cm-marker',n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function gt(e,t,n){var o=e.markedSpans,r=e.text,a=0;if(!o){for(var s=1;sl||k.collapsed&&E.to==l&&E.from==l)?(null!=E.to&&E.to!=l&&c>E.to&&(c=E.to,f=''),k.className&&(g+=' '+k.className),k.css&&(h=(h?h+';':'')+k.css),k.startStyle&&E.from==l&&(y+=' '+k.startStyle),k.endStyle&&E.to==c&&(C||(C=[])).push(k.endStyle,E.to),k.title&&!b&&(b=k.title),k.collapsed&&(!v||0>de(v.marker,k))&&(v=E)):E.from>l&&c>E.from&&(c=E.from)}if(C)for(var m=0;m=d)break;for(var w=vi(d,c);;){if(i){var I=l+i.length;if(!v){var N=I>w?i.slice(0,w-l):i;t.addToken(t,N,u?u+g:g,y,l+N.length==c?f:'',b,h)}if(I>=w){i=i.slice(w-l),l=w;break}l=I,y=''}i=r.slice(a,a=n[p++]),u=dt(n[p++],t.cm.options)}}}function ft(e,t,n){this.line=t,this.rest=ge(t),this.size=this.rest?O(f(this.rest))-n+1:1,this.node=this.text=null,this.hidden=be(e,t)}function yt(e,t,n){for(var o=[],r=t,a,i;rIi&&(e.node.style.zIndex=2)),e.node}function Tt(e,t){var n=t.bgClass?t.bgClass+' '+(t.line.bgClass||''):t.line.bgClass;if(n&&(n+=' CodeMirror-linebackground'),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=kt(t);t.background=r.insertBefore(o('div',null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function wt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):lt(e,t)}function It(e,t){var n=t.text.className,o=wt(e,t);t.text==t.node&&(t.node=o.pre),t.text.parentNode.replaceChild(o.pre,t.text),t.text=o.pre,o.bgClass!=t.bgClass||o.textClass!=t.textClass?(t.bgClass=o.bgClass,t.textClass=o.textClass,Nt(e,t)):n&&(t.text.className=n)}function Nt(e,t){Tt(e,t),t.line.wrapClass?kt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className='');var n=t.textClass?t.textClass+' '+(t.line.textClass||''):t.line.textClass;t.text.className=n||''}function At(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=kt(t);t.gutterBackground=o('div',null,'CodeMirror-gutter-background '+t.line.gutterClass,'left: '+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+'px; width: '+r.gutterTotalWidth+'px'),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var s=kt(t),d=t.gutter=o('div',null,'CodeMirror-gutter-wrapper','left: '+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+'px');if(e.display.input.setUneditable(d),s.insertBefore(d,t.text),t.line.gutterClass&&(d.className+=' '+t.line.gutterClass),!e.options.lineNumbers||i&&i['CodeMirror-linenumbers']||(t.lineNumber=d.appendChild(o('div',_(e.options,n),'CodeMirror-linenumber CodeMirror-gutter-elt','left: '+r.gutterLeft['CodeMirror-linenumbers']+'px; width: '+e.display.lineNumInnerWidth+'px'))),i)for(var l=0;ln)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function zt(e,t){t=he(t);var o=O(t),r=e.display.externalMeasured=new ft(e.doc,t,o);r.lineN=o;var a=r.built=lt(e,r);return r.text=a.pre,n(e.display.lineMeasure,a.pre),r}function Kt(e,t,n,o){return Qt(e,Xt(e,t),n,o)}function Gt(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=l-d,a=i-1,t>=l&&(s='right')),null!=a){if(r=e[o+2],d==l&&n==(r.insertLeft?'left':'right')&&(s=n),'left'==n&&0==a)for(;o&&e[o-2]==e[o-3]&&e[o-1].insertLeft;)r=e[(o-=3)+2],s='left';if('right'==n&&a==l-d)for(;oc;c++){for(;s&&k(t.line.text.charAt(r.coverStart+s));)--s;for(;r.coverStart+dIi&&0==s&&d==r.coverEnd-r.coverStart?a.parentNode.getBoundingClientRect():Jt(zi(a,s,d).getClientRects(),o),p.left||p.right||0==s)break;d=s,--s,l='right'}wi&&11>Ii&&(p=Zt(e.display.measure,p))}else{0Ii&&!s&&(!p||!p.left&&!p.right)){var h=a.parentNode.getClientRects()[0];p=h?{left:h.left,right:h.left+Sn(e.display),top:h.top,bottom:h.bottom}:ws}for(var m=p.top-t.rect.top,g=p.bottom-t.rect.top,f=t.view.measure.heights,y=0;y=o.text.length?(l=o.text.length,p='before'):0>=l&&(l=0,p='after'),!d)return i('before'==p?l-1:l,'before'==p);var c=ke(d,l,p),u=rs,h=s(l,c,'before'==p);return null!=u&&(h.other=s(l,u,'before'!=p)),h}function un(e,t){var n=0;t=q(e.doc,t),e.options.lineWrapping||(n=Sn(e.display)*t.ch);var o=N(e.doc,t.line),r=xe(o)+Ft(e.display);return{left:n,right:n,top:r,bottom:r+o.height}}function hn(e,t,n,o,r){var a=M(e,t,n);return a.xRel=r,o&&(a.outside=!0),a}function mn(e,t,n){var o=e.doc;if(n+=e.display.viewOffset,0>n)return hn(o.first,0,null,!0,-1);var r=P(o,n),a=o.first+o.size-1;if(r>a)return hn(o.first+o.size-1,N(o,a).text.length,null,!0,1);0>t&&(t=0);for(var i=N(o,r);;){var s=bn(e,i,r,t,n),d=ce(i),l=d&&d.find(0,!0);if(d&&(s.ch>l.from.ch||s.ch==l.from.ch&&0o},a,r),{begin:a,end:r}}function fn(e,t,n,o){n||(n=Xt(e,t));var r=dn(e,t,Qt(e,n,o),'line').top;return gn(e,t,n,r)}function yn(e,t,n,o){return!(e.bottom<=n)&&(!!(e.top>n)||(o?e.left:e.right)>t)}function bn(e,t,n,o,r){r-=xe(t);var a=Xt(e,t),i=sn(t),s=0,d=t.text.length,l=!0,p=Te(t,e.doc.direction);if(p){var c=(e.options.lineWrapping?xn:vn)(e,t,n,a,p,o,r);l=1!=c.level,s=l?c.from:c.to-1,d=l?c.to:c.from-1}var u=null,h=null,m=w(function(t){var n=Qt(e,a,t);return(n.top+=i,n.bottom+=i,!!yn(n,o,r,!1))&&(n.top<=r&&n.left<=o&&(u=t,h=n),!0)},s,d),g=!1,f,y;if(h){var b=o-h.left=x.bottom}return m=T(t.text,m,1),hn(n,m,y,g,o-f)}function vn(e,t,n,o,r,a,s){var i=w(function(d){var i=r[d],l=1!=i.level;return yn(cn(e,M(n,l?i.to:i.from,l?'before':'after'),'line',t,o),a,s,!0)},0,r.length-1),d=r[i];if(0s&&(d=r[i-1])}return d}function xn(e,t,n,o,r,a,s){var d=gn(e,t,o,s),l=d.begin,c=d.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,m=0,i;m=c||i.to<=l)){var p=1!=i.level,g=Qt(e,o,p?vi(c,i.to)-1:fi(l,i.from)).right,f=gf)&&(u=i,h=f)}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Cn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ns){Ns=o('pre');for(var r=0;49>r;++r)Ns.appendChild(document.createTextNode('x')),Ns.appendChild(o('br'));Ns.appendChild(document.createTextNode('x'))}n(e.measure,Ns);var a=Ns.offsetHeight/50;return 3=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,o=0;ot)return o}function An(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ln(e,t){void 0===t&&(t=!0);for(var n=e.doc,o={},r=o.cursors=document.createDocumentFragment(),a=o.selection=document.createDocumentFragment(),s=0;s=e.display.viewTo||i.to().linet&&(t=0),t=mi(t),r=mi(r),d.appendChild(o('div',null,'CodeMirror-selected','position: absolute; left: '+e+'px;\n top: '+t+'px; width: '+(null==n?c-e:n)+'px;\n height: '+(r-t)+'px'))}function a(t,n,o){function a(n,o){return pn(e,M(t,n),'div',d,o)}function i(t,n,o){var r=fn(e,d,null,t),i='ltr'==n==('after'==o)?'left':'right',s='after'==o?r.begin:r.end-(/\s/.test(d.text.charAt(r.end-1))?2:1);return a(s,i)[i]}var d=N(s,t),l=d.text.length,h=Te(d,s.direction),m,g;return Ee(h,n||0,null==o?l:o,function(e,t,s,d){var f='ltr'==s,y=a(e,f?'left':'right'),b=a(t-1,f?'right':'left'),v=null==n&&0==e,x=null==o&&t==l,C=0==d,S=!h||d==h.length-1;if(3>=b.top-y.top){var E=(u?v:x)&&C,k=(u?x:v)&&S,T=E?p:(f?y:b).left,w=k?c:(f?b:y).right;r(T,y.top,w-T,y.bottom)}else{var I,N,A,L;f?(I=u&&v&&C?p:y.left,N=u?c:i(e,s,'before'),A=u?p:i(t,s,'after'),L=u&&x&&S?c:b.right):(I=u?i(e,s,'before'):p,N=!u&&v&&C?c:y.right,A=!u&&x&&S?p:b.left,L=u?i(t,s,'after'):c),r(I,y.top,N-I,y.bottom),y.bottomOn(y,m))&&(m=y),0>On(b,m)&&(m=b),(!g||0>On(y,g))&&(g=y),0>On(b,g)&&(g=b)}),{start:m,end:g}}var i=e.display,s=e.doc,d=document.createDocumentFragment(),l=Ut(e.display),p=l.left,c=fi(i.sizerWidth,Wt(e)-i.sizer.offsetLeft)-l.right,u='ltr'==s.direction,h=t.from(),m=t.to();if(h.line==m.line)a(h.line,h.ch,m.ch);else{var g=N(s,h.line),f=N(s,m.line),y=he(g)==he(f),b=a(h.line,h.ch,y?g.text.length+1:null).end,v=a(m.line,y?0:null,m.ch).start;y&&(b.tope.options.cursorBlinkRate&&(t.cursorDiv.style.visibility='hidden')}}function _n(e){e.state.focused||(e.display.input.focus(),Fn(e))}function Mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Bn(e))},100)}function Fn(t,n){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),'nocursor'==t.options.readOnly||(!t.state.focused&&(Ne(t,'focus',t,n),t.state.focused=!0,d(t.display.wrapper,'CodeMirror-focused'),!t.curOp&&t.display.selForContextMenu!=t.doc.sel&&(t.display.input.reset(),Ni&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Dn(t))}function Bn(t,n){t.state.delayingBlurEvent||(t.state.focused&&(Ne(t,'blur',t,n),t.state.focused=!1,ji(t.display.wrapper,'CodeMirror-focused')),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Un(e){for(var t=e.display,n=t.lineDiv.offsetTop,o=0;oIi){var i=r.node.offsetTop+r.node.offsetHeight;a=i-n,n=i}else{var s=r.node.getBoundingClientRect();a=s.bottom-s.top}var d=r.line.height-a;if(2>a&&(a=Cn(t)),(.005d)&&(R(r.line,a),Vn(r.line),r.rest))for(var l=0;l=i&&(a=P(t,xe(N(t,d))-e.wrapper.clientHeight),i=d)}return{from:a,to:fi(i,a+1)}}function Hn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var o=kn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,a=o+'px',s=0;st.top+r.top?a=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null!=a&&!Di){var i=o('div','\u200B',null,'position: absolute;\n top: '+(t.top-n.viewOffset-Ft(e.display))+'px;\n height: '+(t.bottom-t.top+Vt(e)+n.barHeight)+'px;\n left: '+t.left+'px; width: '+fi(2,t.right-t.left)+'px;');e.display.lineSpace.appendChild(i),i.scrollIntoView(a),e.display.lineSpace.removeChild(i)}}}function zn(e,t,n,o){null==o&&(o=0);var r;e.options.lineWrapping||t!=n||(t=t.ch?M(t.line,'before'==t.sticky?t.ch-1:t.ch,'after'):t,n='before'==t.sticky?M(t.line,t.ch+1,'before'):t);for(var a=0;5>a;a++){var i=!1,s=cn(e,t),d=n&&n!=t?cn(e,n):s;r={left:vi(s.left,d.left),top:vi(s.top,d.top)-o,right:fi(s.left,d.left),bottom:fi(s.bottom,d.bottom)+o};var l=Gn(e,r),p=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=l.scrollTop&&(eo(e,l.scrollTop),1t.top&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,a=Ht(e),i={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+Bt(n),d=t.tops-o;if(t.topr+a){var p=vi(t.top,(l?s:t.bottom)-a);p!=r&&(i.scrollTop=p)}var c=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,u=Wt(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>u;return h&&(t.right=t.left+u),10>t.left?i.scrollLeft=0:t.leftu+c-3&&(i.scrollLeft=t.right+(h?0:10)-u),i}function Xn(e,t){null==t||($n(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Qn(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Yn(e,t,n){(null!=t||null!=n)&&$n(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Jn(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=un(e,t.from),o=un(e,t.to);Zn(e,n,o,t.margin)}}function Zn(e,t,n,o){var r=Gn(e,{left:vi(t.left,n.left),top:vi(t.top,n.top)-o,right:fi(t.right,n.right),bottom:fi(t.bottom,n.bottom)+o});Yn(e,r.scrollLeft,r.scrollTop)}function eo(e,t){2>gi(e.doc.scrollTop-t)||(!Si&&Po(e,{top:t}),to(e,t,!0),Si&&Po(e),wo(e,100))}function to(e,t,n){t=vi(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function no(e,t,n,o){t=vi(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:2>gi(e.doc.scrollLeft-t))&&!o||(e.doc.scrollLeft=t,Hn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function oo(e){var t=e.display,n=t.gutters.offsetWidth,o=mi(e.doc.height+Bt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:o,scrollHeight:o+Vt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function ro(e,t){t||(t=oo(e));var n=e.display.barWidth,o=e.display.barHeight;ao(e,t);for(var r=0;4>r&&n!=e.display.barWidth||o!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Un(e),ao(e,oo(e)),n=e.display.barWidth,o=e.display.barHeight}function ao(e,t){var n=e.display,o=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=o.right)+'px',n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+'px',n.heightForcer.style.borderBottom=o.bottom+'px solid transparent',o.right&&o.bottom?(n.scrollbarFiller.style.display='block',n.scrollbarFiller.style.height=o.bottom+'px',n.scrollbarFiller.style.width=o.right+'px'):n.scrollbarFiller.style.display='',o.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display='block',n.gutterFiller.style.height=o.bottom+'px',n.gutterFiller.style.width=t.gutterWidth+'px'):n.gutterFiller.style.display=''}function io(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ji(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ls[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ss(t,'mousedown',function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute('cm-not-content','true')},function(t,n){'horizontal'==n?no(e,t):eo(e,t)},e),e.display.scrollbars.addClass&&d(e.display.wrapper,e.display.scrollbars.addClass)}function so(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Rs},bt(e.curOp)}function lo(e){var t=e.curOp;xt(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Os(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function uo(e){e.updatedDisplay=e.mustUpdate&&Ro(e.cm,e.update)}function ho(e){var t=e.cm,n=t.display;e.updatedDisplay&&Un(t),e.barMeasure=oo(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Kt(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=fi(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Vt(t)+t.display.barWidth),e.maxScrollLeft=fi(0,n.sizer.offsetLeft+e.adjustWidthTo-Wt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function mo(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+'px',e.maxScrollLeftt)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)os&&fe(e.doc,t)r.viewFrom?So(e):(r.viewFrom+=o,r.viewTo+=o);else if(t<=r.viewFrom&&n>=r.viewTo)So(e);else if(t<=r.viewFrom){var a=Eo(e,n,n+o,1);a?(r.view=r.view.slice(a.index),r.viewFrom=a.lineN,r.viewTo+=o):So(e)}else if(n>=r.viewTo){var i=Eo(e,t,t,-1);i?(r.view=r.view.slice(0,i.index),r.viewTo=i.lineN):So(e)}else{var s=Eo(e,t,t,-1),d=Eo(e,n,n+o,1);s&&d?(r.view=r.view.slice(0,s.index).concat(yt(e,s.lineN,d.lineN)).concat(r.view.slice(d.index)),r.viewTo+=o):So(e)}var l=r.externalMeasured;l&&(n=r.lineN&&t=o.viewTo)){var a=o.view[Nn(e,t)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==h(i,n)&&i.push(n)}}}function So(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Eo(e,t,o,r){var a=Nn(e,t),s=e.display.view,d;if(!os||o==e.doc.first+e.doc.size)return{index:a,lineN:o};for(var l=e.display.viewFrom,n=0;nr?0:s.length-1))return null;o+=r*s[a-(0>r?1:0)].size,a+=r}return{index:a,lineN:o}}function ko(e,t,n){var o=e.display,r=o.view;0==r.length||t>=o.viewTo||n<=o.viewFrom?(o.view=yt(e,t,n),o.viewFrom=t):(o.viewFrom>t?o.view=yt(e,t,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Nn(e,n)))),o.viewTo=n}function To(e){for(var t=e.display.view,n=0,o=0,r;o=e.display.viewTo)){var n=+new Date+e.options.workTime,o=Je(e,t.highlightFrontier),r=[];t.iter(o.line,vi(t.first+t.size,e.display.viewTo+500),function(a){if(o.line>=e.display.viewFrom){var s=a.styles,d=a.text.length>e.options.maxHighlightLength?Ke(t.mode,o.state):null,l=Qe(e,a,o,!0);d&&(o.state=d),a.styles=l.styles;var p=a.styleClasses,c=l.classes;c?a.styleClasses=c:p&&(a.styleClasses=null);for(var u=!s||s.length!=a.styles.length||p!=c&&(!p||!c||p.bgClass!=c.bgClass||p.textClass!=c.textClass),h=0;!u&&hn?(wo(e,e.options.workDelay),!0):void 0}),t.highlightFrontier=o.line,t.modeFrontier=fi(t.modeFrontier,o.line),r.length&&fo(e,function(){for(var t=0;t=o.viewFrom&&n.visible.to<=o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&0==To(e))return!1;qn(e)&&(So(e),n.dims=En(e));var a=r.first+r.size,i=fi(n.visible.from-e.options.viewportMargin,r.first),s=vi(a,n.visible.to+e.options.viewportMargin);o.viewFromi-o.viewFrom&&(i=fi(r.first,o.viewFrom)),o.viewTo>s&&20>o.viewTo-s&&(s=vi(a,o.viewTo)),os&&(i=fe(e.doc,i),s=ye(e.doc,s));var d=i!=o.viewFrom||s!=o.viewTo||o.lastWrapHeight!=n.wrapperHeight||o.lastWrapWidth!=n.wrapperWidth;ko(e,i,s),o.viewOffset=xe(N(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+'px';var l=To(e);if(!d&&0==l&&!n.force&&o.renderedView==o.view&&(null==o.updateLineNumbers||o.updateLineNumbers>=o.viewTo))return!1;var p=Ao(e);return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo))break;if(!Ro(e,t))break;Un(e);var r=oo(e);An(e),ro(e,r),Mo(e,r),t.force=!1}t.signal(e,'update',e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,'viewportChange',e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Po(e,t){var n=new Os(e,t);if(Ro(e,n)){Un(e),Oo(e,n);var o=oo(e);An(e),ro(e,o),Mo(e,o),n.finish()}}function Do(e,n,o){function r(t){var n=t.nextSibling;return Ni&&Bi&&e.display.currentWheelTarget==t?t.style.display='none':t.parentNode.removeChild(t),n}for(var a=e.display,s=e.options.lineNumbers,d=a.lineDiv,l=d.firstChild,p=a.view,c=a.viewFrom,u=0,i;us.clientWidth,l=s.scrollHeight>s.clientHeight;if(o&&d||r&&l){if(r&&Bi&&Ni)outer:for(var p=n.target,c=a.view;p!=s;p=p.parentNode)for(var u=0;ui?h=fi(0,h+i-50):m=vi(t.doc.height,m+i+50),Po(t,{top:h,bottom:m})}20>Ps&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=o,a.wheelDY=r,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(Ds=(Ds*Ps+n)/(Ps+1),++Ps)}},200)):(a.wheelDX+=o,a.wheelDY+=r))}}function Ho(e,t){var n=e[t];e.sort(function(e,t){return F(e.from(),t.from())}),t=h(e,n);for(var o=1;oF(e,t.from))return e;if(0>=F(e,t.to))return jo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,o=e.ch;return e.line==t.to.line&&(o+=jo(t).ch-t.to.ch),M(n,o)}function Ko(e,t){for(var n=[],o=0,r;oF(p.head,p.anchor);o[s]=new Ms(c?l:d,c?d:l)}else o[s]=new Ms(d,d)}return new _s(o,e.sel.primIndex)}function Qo(e){e.doc.mode=je(e.options,e.doc.modeOption),Yo(e)}function Yo(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,wo(e,100),e.state.modeGen++,e.curOp&&xo(e)}function Jo(e,t){return 0==t.from.ch&&0==t.to.ch&&''==f(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function $o(e,t,o,n){function r(e){return o?o[e]:null}function a(e,o,r){it(e,o,r,n),Ct(e,'change',e,t)}function i(e,t){for(var o=[],a=e;aa-(e.cm?e.cm.options.historyEventDelay:500)||'*'==t.origin.charAt(0)))&&(i=ir(r,r.lastOp==o)))s=f(i.changes),0==F(t.from,t.to)&&0==F(t.from,s.to)?s.to=jo(t):i.changes.push(rr(e,t));else{var d=f(r.done);for(d&&d.ranges||pr(e.sel,r.done),i={changes:[rr(e,t)],generation:r.generation},r.done.push(i);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=t.origin,s||Ne(e,'historyAdded')}function dr(e,t,n,o){var r=t.charAt(0);return'*'==r||'+'==r&&n.ranges.length==o.ranges.length&&n.somethingSelected()==o.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function lr(e,t,n,o){var r=e.history,a=o&&o.origin;n==r.lastSelOp||a&&r.lastSelOrigin==a&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==a||dr(e,a,f(r.done),t))?r.done[r.done.length-1]=t:pr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=a,r.lastSelOp=n,o&&!1!==o.clearRedo&&ar(r.undone)}function pr(e,t){var n=f(t);n&&n.ranges&&n.equals(e)||t.push(e)}function cr(e,t,o,r){var a=t['spans_'+e.id],i=0;e.iter(fi(e.first,o),vi(e.first+e.size,r),function(n){n.markedSpans&&((a||(a=t['spans_'+e.id]={}))[i]=n.markedSpans),++i})}function ur(e){if(!e)return null;for(var t=0,n;tF(t,r);a==0>F(n,r)?a!=0>F(t,n)&&(t=n):(r=t,t=n)}return new Ms(r,t)}return new Ms(n||t,t)}function yr(e,t,n,o,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Er(e,new _s([fr(e.sel.primary(),t,n,r)],0),o)}function br(e,t,n){for(var o=[],r=e.cm&&(e.cm.display.shift||e.extend),a=0;aF(t.primary().head,e.sel.primary().head)?-1:1);Tr(e,Ir(e,t,o,!0)),!(n&&!1===n.scroll)&&e.cm&&Qn(e.cm)}function Tr(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Le(e.cm)),Ct(e,'cursorActivity',e))}function wr(e){Tr(e,Ir(e,e.sel,null,!1))}function Ir(e,t,n,o){for(var r=0,a;r=t.ch:i.to>t.ch))){if(r&&(Ne(d,'beforeCursorEnter'),d.explicitlyCleared))if(!a.markedSpans)break;else{--s;continue}if(!d.atomic)continue;if(n){var l=d.find(0>o?1:-1),p=void 0;if((0>o?d.inclusiveRight:d.inclusiveLeft)&&(l=Lr(e,l,-o,l&&l.line==t.line?a:null)),l&&l.line==t.line&&(p=F(l,n))&&(0>o?0>p:0o?-1:1);return(0>o?d.inclusiveLeft:d.inclusiveRight)&&(c=Lr(e,c,o,c.line==t.line?a:null)),c?Nr(e,c,t,o,r):null}}return t}function Ar(e,t,n,o,r){var a=o||1,i=Nr(e,t,n,a,r)||!r&&Nr(e,t,n,a,!0)||Nr(e,t,n,-a,r)||!r&&Nr(e,t,n,-a,!0);return i?i:(e.cantEdit=!0,M(e.first,0))}function Lr(e,t,n,o){return 0>n&&0==t.ch?t.line>e.first?q(e,M(t.line-1)):null:0e.lastLine())){if(t.from.linea&&(t={from:t.from,to:M(a,N(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=A(e,t.from,t.to),n||(n=Ko(e,t)),e.cm?Br(e.cm,t,o):$o(e,t,o),kr(e,n,Yi)}}function Br(e,t,n){var o=e.doc,r=e.display,a=t.from,i=t.to,s=!1,d=a.line;e.options.lineWrapping||(d=O(he(N(o,a.line))),o.iter(d,i.line+1,function(e){if(e==r.maxLine)return s=!0,!0})),-1r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),at(o,a.line),wo(e,400);var l=t.text.length-(i.line-a.line)-1;t.full?xo(e):a.line!=i.line||1!=t.text.length||Jo(e.doc,t)?xo(e,a.line,i.line+1,l):Co(e,a.line,'text');var p=Re(e,'changes'),c=Re(e,'change');if(c||p){var u={from:a,to:i,text:t.text,removed:t.removed,origin:t.origin};c&&Ct(e,'change',e,u),p&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(u)}e.display.selForContextMenu=null}function Ur(e,t,n,o,r){if(o||(o=n),0>F(o,n)){var a;a=[o,n],n=a[0],o=a[1],a}'string'==typeof t&&(t=e.splitLines(t)),Pr(e,{from:n,to:o,text:t,origin:r})}function Vr(e,t,n,o){n+new Date-qs))return void Me(n);if(!(Ae(t,n)||Mt(t.display,n))&&(n.dataTransfer.setData('Text',t.getSelection()),n.dataTransfer.effectAllowed='copyMove',n.dataTransfer.setDragImage&&!Oi)){var e=o('img',null,null,'position: fixed; left: 0; top: 0;');e.src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',Ri&&(e.width=e.height=1,t.display.wrapper.appendChild(e),e._top=e.offsetTop),n.dataTransfer.setDragImage(e,0,0),Ri&&e.parentNode.removeChild(e)}}function ta(t,r){var e=In(t,r);if(e){var a=document.createDocumentFragment();Rn(t,e,a),t.display.dragCursor||(t.display.dragCursor=o('div',null,'CodeMirror-cursors CodeMirror-dragcursors'),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),n(t.display.dragCursor,a)}}function na(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function oa(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName('CodeMirror'),n=0,o;n=F(a.from,f(o).to);){var i=o.pop();if(0>F(i.from,a.from)){a.from=i.from;break}}o.push(a)}fo(e,function(){for(var t=o.length-1;0<=t;t--)Ur(e.doc,'',o[t].from,o[t].to,'+delete');Qn(e)})}function ga(e,t,n){var o=T(e.text,t+n,n);return 0>o||o>e.text.length?null:o}function fa(e,t,n){var o=ga(e,t.ch,n);return null==o?null:new M(t.line,o,0>n?'after':'before')}function ya(e,t,n,o,r){if(e){var a=Te(n,t.doc.direction);if(a){var i=0>r?f(a):a[0],s=0>r==(1==i.level),d=s?'after':'before',l;if(0r?n.text.length-1:0;var c=Qt(t,p,l).top;l=w(function(e){return Qt(t,p,e).top==c},0>r==(1==i.level)?i.from:i.to-1,l),'before'==d&&(l=ga(n,l,1))}else l=0>r?i.to:i.from;return new M(o,l,d)}}return new M(o,0>r?n.text.length:0,0>r?'before':'after')}function ba(e,t,n,o){var r=Te(t,e.doc.direction);if(!r)return fa(t,n,o);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky='before'):0>=n.ch&&(n.ch=0,n.sticky='after');var a=ke(r,n.ch,n.sticky),i=r[a];if('ltr'==e.doc.direction&&0==i.level%2&&(0n.ch:i.fromo,u=s(n,c?1:-1);if(null!=u&&(c?u<=i.to&&u<=l.end:u>=i.from&&u>=l.begin)){var h=c?'before':'after';return new M(n.line,u,h)}}var m=function(e,t,o){for(var a=function(e,t){return t?new M(n.line,s(e,1),'before'):new M(n.line,e,'after')};0<=e&&eIi&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var o=wa(e,t);Ri&&(Js=o?n:null,!o&&88==n&&!ps&&(Bi?t.metaKey:t.ctrlKey)&&e.replaceSelection('',null,'cut')),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||Aa(e)}}function Aa(e){function t(o){18!=o.keyCode&&o.altKey||(ji(n,'CodeMirror-crosshair'),Ie(document,'keyup',t),Ie(document,'mouseover',t))}var n=e.display.lineDiv;d(n,'CodeMirror-crosshair'),ss(document,'keyup',t),ss(document,'mouseover',t)}function La(t){16==t.keyCode&&(this.doc.sel.shift=!1),Ae(this,t)}function Ra(t){var e=this;if(!(Mt(e.display,t)||Ae(e,t)||t.ctrlKey&&!t.altKey||Bi&&t.metaKey)){var n=t.keyCode,o=t.charCode;if(Ri&&n==Js)return Js=null,void Pe(t);if(!(Ri&&(!t.which||10>t.which)&&wa(e,t))){var r=hi(null==o?n:o);'\b'==r||Ia(e,t,r)||e.display.input.onKeyPress(t)}}}function Oa(e,t){var n=+new Date;return od&&od.compare(n,e,t)?(nd=od=null,'triple'):nd&&nd.compare(n,e,t)?(od=new $s(n,e,t),nd=null,'double'):(nd=new $s(n,e,t),od=null,'single')}function Pa(t){var e=this,n=e.display;if(!(Ae(e,t)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=t.shiftKey,Mt(n,t))return void(Ni||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100)));if(!Ha(e,t)){var o=In(e,t),r=Be(t),a=o?Oa(o,r):'single';window.focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),o&&Da(e,r,o,a,t)||(1==r?o?Ma(e,o,a,t):Fe(t)==n.scroller&&Pe(t):2==r?(o&&yr(e.doc,o),setTimeout(function(){return n.input.focus()},20)):3==r&&(qi?qa(e,t):Mn(e)))}}}function Da(e,t,n,o,r){var a='Click';return'double'==o?a='Double'+a:'triple'==o&&(a='Triple'+a),a=(1==t?'Left':2==t?'Middle':'Right')+a,ka(e,ca(a,r),r,function(t){if('string'==typeof t&&(t=Qs[t]),!t)return!1;var o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o=t(e,n)!=Qi}finally{e.state.suppressEdits=!1}return o})}function _a(e,t,n){var o=e.getOption('configureMouse'),r=o?o(e,t,n):{};if(null==r.unit){var a=Ui?n.shiftKey&&n.metaKey:n.altKey;r.unit=a?'rectangle':'single'==t?'char':'double'==t?'word':'line'}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=Bi?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=Bi?!n.altKey:!n.ctrlKey),r}function Ma(e,t,n,o){wi?setTimeout(p(_n,e),0):e.curOp.focus=s();var r=_a(e,n,o),a=e.doc.sel,i;e.options.dragDrop&&on&&!e.isReadOnly()&&'single'==n&&-1<(i=a.contains(t))&&(0>F((i=a.ranges[i]).from(),t)||0t.xRel)?Fa(e,o,t,r):Ua(e,o,t,r)}function Fa(t,e,n,o){var r=t.display,a=!1,i=yo(t,function(l){Ni&&(r.scroller.draggable=!1),t.state.draggingText=!1,Ie(r.wrapper.ownerDocument,'mouseup',i),Ie(r.wrapper.ownerDocument,'mousemove',s),Ie(r.scroller,'dragstart',d),Ie(r.scroller,'drop',i),a||(Pe(l),!o.addNew&&yr(t.doc,n,null,null,o.extend),Ni||wi&&9==Ii?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),s=function(t){a=a||10<=gi(e.clientX-t.clientX)+gi(e.clientY-t.clientY)},d=function(){return a=!0};Ni&&(r.scroller.draggable=!0),t.state.draggingText=i,i.copy=!o.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ss(r.wrapper.ownerDocument,'mouseup',i),ss(r.wrapper.ownerDocument,'mousemove',s),ss(r.scroller,'dragstart',d),ss(r.scroller,'drop',i),Mn(t),setTimeout(function(){return r.input.focus()},20)}function Ba(e,t,n){if('char'==n)return new Ms(t,t);if('word'==n)return e.findWordAt(t);if('line'==n)return new Ms(M(t.line,0),q(e.doc,M(t.line+1,0)));var o=n(e,t);return new Ms(o.from,o.to)}function Ua(t,e,n,o){function r(e){if(0!=F(y,e))if(y=e,'rectangle'==o.unit){for(var r=[],a=t.options.tabSize,i=u(N(l,n.line).text,n.ch,a),s=u(N(l,e.line).text,e.ch,a),d=vi(i,s),c=fi(i,s),f=vi(n.line,e.line),b=vi(t.lastLine(),fi(n.line,e.line));f<=b;f++){var v=N(l,f).text,x=m(v,d,a);d==c?r.push(new Ms(M(f,x),M(f,x))):v.length>x&&r.push(new Ms(M(f,x),M(f,m(v,c,a))))}r.length||r.push(new Ms(n,n)),Er(l,Ho(p.ranges.slice(0,g).concat(r),g),{origin:'*mouse',scroll:!1}),t.scrollIntoView(e)}else{var C=h,S=Ba(t,e,o.unit),E=C.anchor,k;0=p.to||i.lineb.bottom?20:0;c&&setTimeout(yo(t,function(){v!=e||(d.scroller.scrollTop+=c,a(n))}),50)}}function i(n){t.state.selectingText=!1,v=Infinity,Pe(n),d.input.focus(),Ie(d.wrapper.ownerDocument,'mousemove',x),Ie(d.wrapper.ownerDocument,'mouseup',C),l.history.lastSelOrigin=null}var d=t.display,l=t.doc;Pe(e);var p=l.sel,c=p.ranges,h,g;if(o.addNew&&!o.extend?(g=l.sel.contains(n),h=-1c:0=yi(t.display.gutters.getBoundingClientRect().right))return!1;o&&Pe(n);var s=t.display,d=s.lineDiv.getBoundingClientRect();if(a>d.bottom||!Re(t,e))return _e(n);a-=d.top-s.viewOffset;for(var l=0,i;l=r){var p=P(t.doc,a),c=t.options.gutters[l];return Ne(t,e,t,p,c,n),_e(n)}}function Ha(t,n){return Wa(t,n,'gutterClick',!0)}function qa(t,n){Mt(t.display,n)||ja(t,n)||Ae(t,n,'contextmenu')||t.display.input.onContextMenu(n)}function ja(t,n){return!!Re(t,'gutterContextMenu')&&Wa(t,n,'gutterContextMenu',!1)}function za(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,'')+e.options.theme.replace(/(^|\s)\s*/g,' cm-s-'),nn(e)}function Ka(e){Fo(e),xo(e),Hn(e)}function Ga(e,t,n){if(!t!=!(n&&n!=Zs)){var o=e.display.dragFunctions,r=t?ss:Ie;r(e.display.scroller,'dragstart',o.start),r(e.display.scroller,'dragenter',o.enter),r(e.display.scroller,'dragover',o.over),r(e.display.scroller,'dragleave',o.leave),r(e.display.scroller,'drop',o.drop)}}function Xa(e){e.options.lineWrapping?(d(e.display.wrapper,'CodeMirror-wrap'),e.display.sizer.style.minWidth='',e.display.sizerWidth=null):(ji(e.display.wrapper,'CodeMirror-wrap'),Se(e)),wn(e),xo(e),nn(e),setTimeout(function(){return ro(e)},100)}function Qa(e,t){var n=this;if(!(this instanceof Qa))return new Qa(e,t);this.options=t=t?c(t):{},c(ed,t,!1),Bo(t);var o=t.value;'string'==typeof o&&(o=new Hs(o,t.mode,null,t.lineSeparator,t.direction)),this.doc=o;var r=new Qa.inputStyles[t.inputStyle](this),a=this.display=new I(e,o,r);for(var s in a.wrapper.CodeMirror=this,Fo(this),za(this),t.lineWrapping&&(this.display.wrapper.className+=' CodeMirror-wrap'),io(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Gi,keySeq:null,specialChars:null},t.autofocus&&!Fi&&a.input.focus(),wi&&11>Ii&&setTimeout(function(){return n.display.input.reset(!0)},20),Ya(this),ra(),so(this),this.curOp.forceUpdate=!0,er(this,o),t.autofocus&&!Fi||this.hasFocus()?setTimeout(p(Fn,this),20):Bn(this),td)td.hasOwnProperty(s)&&td[s](n,t[s],Zs);qn(this),t.finishInit&&t.finishInit(this);for(var d=0;d=e.radiusX&&1>=e.radiusY}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,o=t.top-e.top;return 400Ii?ss(a.scroller,'dblclick',yo(t,function(n){if(!Ae(t,n)){var e=In(t,n);if(!(!e||Ha(t,n)||Mt(t.display,n))){Pe(n);var o=t.findWordAt(e);yr(t.doc,o.anchor,o.head)}}})):ss(a.scroller,'dblclick',function(n){return Ae(t,n)||Pe(n)}),qi||ss(a.scroller,'contextmenu',function(n){return qa(t,n)});var i={end:0},s;ss(a.scroller,'touchstart',function(n){if(!Ae(t,n)&&!o(n)&&!Ha(t,n)){a.input.ensurePolled(),clearTimeout(s);var e=+new Date;a.activeTouch={start:e,moved:!1,prev:300>=e-i.end?i:null},1==n.touches.length&&(a.activeTouch.left=n.touches[0].pageX,a.activeTouch.top=n.touches[0].pageY)}}),ss(a.scroller,'touchmove',function(){a.activeTouch&&(a.activeTouch.moved=!0)}),ss(a.scroller,'touchend',function(o){var e=a.activeTouch;if(e&&!Mt(a,o)&&null!=e.left&&!e.moved&&300>new Date-e.start){var i=t.coordsChar(a.activeTouch,'page'),s;s=!e.prev||r(e,e.prev)?new Ms(i,i):!e.prev.prev||r(e,e.prev.prev)?t.findWordAt(i):new Ms(M(i.line,0),q(t.doc,M(i.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),Pe(o)}n()}),ss(a.scroller,'touchcancel',n),ss(a.scroller,'scroll',function(){a.scroller.clientHeight&&(eo(t,a.scroller.scrollTop),no(t,a.scroller.scrollLeft,!0),Ne(t,'scroll',t))}),ss(a.scroller,'mousewheel',function(n){return Wo(t,n)}),ss(a.scroller,'DOMMouseScroll',function(n){return Wo(t,n)}),ss(a.wrapper,'scroll',function(){return a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(n){Ae(t,n)||Me(n)},over:function(n){Ae(t,n)||(ta(t,n),Me(n))},start:function(n){return ea(t,n)},drop:yo(t,Zr),leave:function(n){Ae(t,n)||na(t)}};var e=a.input.getField();ss(e,'keyup',function(n){return La.call(t,n)}),ss(e,'keydown',yo(t,Na)),ss(e,'keypress',yo(t,Ra)),ss(e,'focus',function(n){return Fn(t,n)}),ss(e,'blur',function(n){return Bn(t,n)})}function Ja(e,t,n,o){var r=e.doc,a;null==n&&(n='add'),'smart'==n&&(r.mode.indent?a=Je(e,t).state:n='prev');var s=e.options.tabSize,d=N(r,t),l=u(d.text,null,s);d.stateAfter&&(d.stateAfter=null);var p=d.text.match(/^\s*/)[0],c;if(!o&&!/\S/.test(d.text))c=0,n='not';else if('smart'==n&&(c=r.mode.indent(a,d.text.slice(p.length),d.text),c==Qi||150r.first?c=u(N(r,t-1).text,null,s):c=0:'add'==n?c=l+e.options.indentUnit:'subtract'==n?c=l-e.options.indentUnit:'number'==typeof n&&(c=l+n),c=fi(0,c);var h='',m=0;if(e.options.indentWithTabs)for(var f=yi(c/s);f;--f)m+=s,h+='\t';if(m=e.first+e.size?!1:(t=new M(o,t.ch,t.sticky),p=N(e,o))}function i(o){var i;if(i=r?ba(e.cm,p,t,n):fa(p,t,n),null!=i)t=i;else if(!o&&a())t=ya(r,e.cm,p,t.line,n);else return!1;return!0}var s=t,d=n,p=N(e,t.line);if('char'==o)i();else if('column'==o)i(!0);else if('word'==o||'group'==o)for(var l=null,c='group'==o,u=e.cm&&e.cm.getHelper(t,'wordChars'),h=!0;;h=!1){if(0>n&&!i(!h))break;var m=p.text.charAt(t.ch)||'\n',g=S(m,u)?'w':c&&'\n'==m?'n':!c||/\s/.test(m)?null:'p';if(!c||h||g||(g='s'),l&&l!=g){0>n&&(n=1,i(),t.sticky='after');break}if(g&&(l=g),0n?0>=i:i>=r.height){l.hitSide=!0;break}i+=5*n}return l}function si(e,t){var n=Gt(e,t.line);if(!n||n.hidden)return null;var o=N(e.doc,t.line),r=jt(n,o,t.line),a=Te(o,e.doc.direction),i='left';if(a){var s=ke(a,t.ch);i=s%2?'right':'left'}var d=Yt(r.map,t.ch,i);return d.offset='right'==d.collapse?d.end:d.start,d}function di(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function pi(e,t,n,o,r){function a(e){return function(t){return t.id==e}}function s(){p&&(i+=c,p=!1)}function d(e){e&&(s(),i+=e)}function l(t){if(1==t.nodeType){var n=t.getAttribute('cm-text');if(null!=n)return void d(n||t.textContent.replace(/\u200b/g,''));var u=t.getAttribute('cm-marker'),h;if(u){var m=e.findMarks(M(o,0),M(r+1,0),a(+u));return void(m.length&&(h=m[0].find(0))&&d(A(e.doc,h.from,h.to).join(c)))}if('false'==t.getAttribute('contenteditable'))return;var g=/^(pre|div|p)$/i.test(t.nodeName);g&&s();for(var f=0;fr?p.map:c[r];for(var i=0,s;ir?e.line:e.rest[r]),l=a[i]+o;return(0>o||s!=t)&&(l=a[i+(o?1:0)]),M(d,l)}}}var r=e.text.firstChild,i=!1;if(!t||!a(r,t))return li(M(O(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var s=e.rest?f(e.rest):e.line;return li(M(O(s),s.text.length),i)}var d=3==t.nodeType?t:null,l=t;for(d||1!=t.childNodes.length||3!=t.firstChild.nodeType||(d=t.firstChild,n&&(n=d.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var p=e.measure,c=p.maps,u=o(d,l,n);if(u)return li(u,i);for(var h=l.nextSibling,m=d?d.nodeValue.length-n:0;h;h=h.nextSibling){if(u=o(h,h.firstChild,0),u)return li(M(u.line,u.ch-m),i);m+=h.textContent.length}for(var g=l.previousSibling,y=n;g;g=g.previousSibling){if(u=o(g,g.firstChild,-1),u)return li(M(u.line,u.ch+y),i);y+=g.textContent.length}}var hi=String.fromCharCode,mi=Math.round,gi=Math.abs,fi=Math.max,yi=Math.floor,bi=Math.ceil,vi=Math.min,xi=navigator.userAgent,Ci=navigator.platform,Si=/gecko\/\d/i.test(xi),Ei=/MSIE \d/.test(xi),ki=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xi),Ti=/Edge\/(\d+)/.exec(xi),wi=Ei||ki||Ti,Ii=wi&&(Ei?document.documentMode||6:+(Ti||ki)[1]),Ni=!Ti&&/WebKit\//.test(xi),Ai=Ni&&/Qt\/\d+\.\d+/.test(xi),Li=!Ti&&/Chrome\//.test(xi),Ri=/Opera\//.test(xi),Oi=/Apple Computer/.test(navigator.vendor),Pi=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(xi),Di=/PhantomJS/.test(xi),_i=!Ti&&/AppleWebKit/.test(xi)&&/Mobile\/\w+/.test(xi),Mi=/Android/.test(xi),Fi=_i||Mi||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(xi),Bi=_i||/Mac/.test(Ci),Ui=/\bCrOS\b/.test(xi),Vi=/win/i.test(Ci),Wi=Ri&&xi.match(/Version\/(\d*\.\d*)/);Wi&&(Wi=+Wi[1]),Wi&&15<=Wi&&(Ri=!1,Ni=!0);var Hi=Bi&&(Ai||Ri&&(null==Wi||12.11>Wi)),qi=Si||wi&&9<=Ii,ji=function(t,n){var o=t.className,r=e(n).exec(o);if(r){var a=o.slice(r.index+r[0].length);t.className=o.slice(0,r.index)+(a?r[1]+a:'')}},zi;zi=document.createRange?function(e,t,n,o){var a=document.createRange();return a.setEnd(o||e,n),a.setStart(e,t),a}:function(e,t,n){var o=document.body.createTextRange();try{o.moveToElementText(e.parentNode)}catch(t){return o}return o.collapse(!0),o.moveEnd('character',n),o.moveStart('character',t),o};var Ki=function(e){e.select()};_i?Ki=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:wi&&(Ki=function(e){try{e.select()}catch(e){}});var Gi=function(){this.id=null};Gi.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Xi=30,Qi={toString:function(){return'CodeMirror.Pass'}},Yi={scroll:!1},Ji={origin:'*mouse'},$i={origin:'+move'},Zi=[''],es=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ts=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,ns=!1,os=!1,rs=null,as=function(){function e(e){return 247>=e?n.charAt(e):1424<=e&&1524>=e?'R':1536<=e&&1785>=e?o.charAt(e-1536):1774<=e&&2220>=e?'r':8192<=e&&8203>=e?'w':8204==e?'b':'L'}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n='bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN',o='nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111',r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,i=/[LRr]/,s=/[Lb1n]/,d=/[1n]/;return function(n,o){var l='ltr'==o?'L':'R';if(0==n.length||'ltr'==o&&!r.test(n))return!1;for(var p=n.length,c=[],u=0;uIi)return!1;var e=o('div');return'draggable'in e||'dragDrop'in e}(),ds=3=='\n\nb'.split(/\n/).length?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],o=e.length,r;t<=o;){r=e.indexOf('\n',t),-1==r&&(r=e.length);var a=e.slice(t,'\r'==e.charAt(r-1)?r-1:r),i=a.indexOf('\r');-1==i?(n.push(a),t=r+1):(n.push(a.slice(0,i)),t+=i+1)}return n},ls=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(t){}return t&&t.parentElement()==e&&0!=t.compareEndPoints('StartToEnd',t)},ps=function(){var t=o('div');return!!('oncopy'in t)||(t.setAttribute('oncopy','return;'),'function'==typeof t.oncopy)}(),cs=null,us={},hs={},ms={},gs=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n},fs,ys;gs.prototype.eol=function(){return this.pos>=this.string.length},gs.prototype.sol=function(){return this.pos==this.lineStart},gs.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},gs.prototype.next=function(){if(this.post},gs.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},gs.prototype.skipToEnd=function(){this.pos=this.string.length},gs.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},vs.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,''),size:this.baseTokens[this.baseTokenPos]-e}},vs.prototype.nextLine=function(){this.line++,0Ii&&(this.horiz.style.minHeight=this.vert.style.minWidth='18px')},Ns;Is.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;if(n){this.vert.style.display='block',this.vert.style.bottom=t?o+'px':'0';var r=e.viewHeight-(t?o:0);this.vert.firstChild.style.height=fi(0,e.scrollHeight-e.clientHeight+r)+'px'}else this.vert.style.display='',this.vert.firstChild.style.height='0';if(t){this.horiz.style.display='block',this.horiz.style.right=n?o+'px':'0',this.horiz.style.left=e.barLeft+'px';var a=e.viewWidth-e.barLeft-(n?o:0);this.horiz.firstChild.style.width=fi(0,e.scrollWidth-e.clientWidth+a)+'px'}else this.horiz.style.display='',this.horiz.firstChild.style.width='0';return!this.checkedZeroWidth&&0=F(e,r.to()))return o;return-1};var Ms=function(e,t){this.anchor=e,this.head=t};Ms.prototype.from=function(){return W(this.anchor,this.head)},Ms.prototype.to=function(){return V(this.anchor,this.head)},Ms.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},jr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,o=e,r;othis.size-t&&(1=this.children.length)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new zr(t);if(!e.parent){var o=new zr(e.children);o.parent=e,e.children=[o,n],e=o}else{e.size-=n.size,e.height-=n.height;var r=h(e.parent.children,e);e.parent.children.splice(r+1,0,n)}n.parent=e.parent}while(10t.display.maxLineLength&&(t.display.maxLine=p,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&xo(t,r,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&wr(t.doc)),t&&Ct(t,'markerCleared',t,this,r,a),n&&lo(t),this.parent&&this.parent.clear()}},Us.prototype.find=function(e,t){var n=this;null==e&&'bookmark'==this.type&&(e=1);for(var o=0,r,a;o=e.ch)&&t.push(r.marker.parent||r.marker);return t},findMarks:function(e,t,n){e=q(this,e),t=q(this,t);var o=[],r=e.line;return this.iter(e.line,t.line+1,function(a){var s=a.markedSpans;if(s)for(var d=0,i;d=i.to||null==i.from&&r!=e.line||null!=i.from&&r==t.line&&i.from>=t.ch||n&&!n(i.marker)||o.push(i.marker.parent||i.marker);++r}),o},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var o=0;oe?(o=e,!0):void(e-=a,++t)}),q(this,M(t,o))},indexFromPos:function(e){e=q(this,e);var t=e.ch;if(e.linee.ch)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Hs(L(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.toKs;Ks++)zs[Ks+48]=zs[Ks+96]=Ks+'';for(var i=65;90>=i;i++)zs[i]=hi(i);for(var Gs=1;12>=Gs;Gs++)zs[Gs+111]=zs[Gs+63235]='F'+Gs;var Xs={};Xs.basic={Left:'goCharLeft',Right:'goCharRight',Up:'goLineUp',Down:'goLineDown',End:'goLineEnd',Home:'goLineStartSmart',PageUp:'goPageUp',PageDown:'goPageDown',Delete:'delCharAfter',Backspace:'delCharBefore',"Shift-Backspace":'delCharBefore',Tab:'defaultTab',"Shift-Tab":'indentAuto',Enter:'newlineAndIndent',Insert:'toggleOverwrite',Esc:'singleSelection'},Xs.pcDefault={"Ctrl-A":'selectAll',"Ctrl-D":'deleteLine',"Ctrl-Z":'undo',"Shift-Ctrl-Z":'redo',"Ctrl-Y":'redo',"Ctrl-Home":'goDocStart',"Ctrl-End":'goDocEnd',"Ctrl-Up":'goLineUp',"Ctrl-Down":'goLineDown',"Ctrl-Left":'goGroupLeft',"Ctrl-Right":'goGroupRight',"Alt-Left":'goLineStart',"Alt-Right":'goLineEnd',"Ctrl-Backspace":'delGroupBefore',"Ctrl-Delete":'delGroupAfter',"Ctrl-S":'save',"Ctrl-F":'find',"Ctrl-G":'findNext',"Shift-Ctrl-G":'findPrev',"Shift-Ctrl-F":'replace',"Shift-Ctrl-R":'replaceAll',"Ctrl-[":'indentLess',"Ctrl-]":'indentMore',"Ctrl-U":'undoSelection',"Shift-Ctrl-U":'redoSelection',"Alt-U":'redoSelection',fallthrough:'basic'},Xs.emacsy={"Ctrl-F":'goCharRight',"Ctrl-B":'goCharLeft',"Ctrl-P":'goLineUp',"Ctrl-N":'goLineDown',"Alt-F":'goWordRight',"Alt-B":'goWordLeft',"Ctrl-A":'goLineStart',"Ctrl-E":'goLineEnd',"Ctrl-V":'goPageDown',"Shift-Ctrl-V":'goPageUp',"Ctrl-D":'delCharAfter',"Ctrl-H":'delCharBefore',"Alt-D":'delWordAfter',"Alt-Backspace":'delWordBefore',"Ctrl-K":'killLine',"Ctrl-T":'transposeChars',"Ctrl-O":'openLine'},Xs.macDefault={"Cmd-A":'selectAll',"Cmd-D":'deleteLine',"Cmd-Z":'undo',"Shift-Cmd-Z":'redo',"Cmd-Y":'redo',"Cmd-Home":'goDocStart',"Cmd-Up":'goDocStart',"Cmd-End":'goDocEnd',"Cmd-Down":'goDocEnd',"Alt-Left":'goGroupLeft',"Alt-Right":'goGroupRight',"Cmd-Left":'goLineLeft',"Cmd-Right":'goLineRight',"Alt-Backspace":'delGroupBefore',"Ctrl-Alt-Backspace":'delGroupAfter',"Alt-Delete":'delGroupAfter',"Cmd-S":'save',"Cmd-F":'find',"Cmd-G":'findNext',"Shift-Cmd-G":'findPrev',"Cmd-Alt-F":'replace',"Shift-Cmd-Alt-F":'replaceAll',"Cmd-[":'indentLess',"Cmd-]":'indentMore',"Cmd-Backspace":'delWrappedLineLeft',"Cmd-Delete":'delWrappedLineRight',"Cmd-U":'undoSelection',"Shift-Cmd-U":'redoSelection',"Ctrl-Up":'goDocStart',"Ctrl-Down":'goDocEnd',fallthrough:['basic','emacsy']},Xs['default']=Bi?Xs.macDefault:Xs.pcDefault;var Qs={selectAll:Rr,singleSelection:function(e){return e.setSelection(e.getCursor('anchor'),e.getCursor('head'),Yi)},killLine:function(e){return ma(e,function(t){if(t.empty()){var n=N(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.linee.doc.first){var i=N(e.doc,r.line-1).text;i&&(r=new M(r.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),M(r.line-1,i.length-1),r,'+transpose'))}n.push(new Ms(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){return fo(e,function(){for(var t=e.listSelections(),n=t.length-1;0<=n;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,'+input');t=e.listSelections();for(var o=0;oe&&0==F(t,this.pos)&&n==this.button};var Zs={toString:function(){return'CodeMirror.Init'}},ed={},td={},nd,od;Qa.defaults=ed,Qa.optionHandlers=td;var rd=[];Qa.defineInitHook=function(e){return rd.push(e)};var ad=null,id=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Gi,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};id.prototype.init=function(e){function t(t){if(!Ae(r,t)){if(r.somethingSelected())$a({lineWise:!1,text:r.getSelections()}),'cut'==t.type&&r.replaceSelection('',null,'cut');else{if(!r.options.lineWiseCopyCut)return;var e=ni(r);$a({lineWise:!0,text:e.text}),'cut'==t.type&&r.operation(function(){r.setSelections(e.ranges,0,Yi),r.replaceSelection('',null,'cut')})}if(t.clipboardData){t.clipboardData.clearData();var n=ad.text.join('\n');if(t.clipboardData.setData('Text',n),t.clipboardData.getData('Text')==n)return void t.preventDefault()}var i=ri(),s=i.firstChild;r.display.lineSpace.insertBefore(i,r.display.lineSpace.firstChild),s.value=ad.text.join('\n');var d=document.activeElement;Ki(s),setTimeout(function(){r.display.lineSpace.removeChild(i),d.focus(),d==a&&o.showPrimarySelection()},50)}}var n=this,o=this,r=o.cm,a=o.div=e.lineDiv;oi(a,r.options.spellcheck),ss(a,'paste',function(t){Ae(r,t)||ei(t,r)||11>=Ii&&setTimeout(yo(r,function(){return n.updateFromDOM()}),20)}),ss(a,'compositionstart',function(t){n.composing={data:t.data,done:!1}}),ss(a,'compositionupdate',function(t){n.composing||(n.composing={data:t.data,done:!1})}),ss(a,'compositionend',function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),ss(a,'touchstart',function(){return o.forceCompositionEnd()}),ss(a,'input',function(){n.composing||n.readFromDOMSoon()}),ss(a,'copy',t),ss(a,'cut',t)},id.prototype.prepareSelection=function(){var e=Ln(this.cm,!1);return e.focus=this.cm.state.focused,e},id.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},id.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),o=n.from(),r=n.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||r.line=t.display.viewFrom&&si(t,o)||{node:s[0].measure.map[2],offset:0},l=r.linee.firstLine()&&(o=M(o.line-1,N(e.doc,o.line-1).length)),r.ch==N(e.doc,r.line).text.length&&r.linet.viewTo-1)return!1;var a,i,s;o.line==t.viewFrom||0==(a=Nn(e,o.line))?(i=O(t.view[0].line),s=t.view[0].node):(i=O(t.view[a].line),s=t.view[a-1].node.nextSibling);var d=Nn(e,r.line),l,p;if(d==t.view.length-1?(l=t.viewTo-1,p=t.lineDiv.lastChild):(l=O(t.view[d+1].line)-1,p=t.view[d+1].node.previousSibling),!s)return!1;for(var c=e.doc.splitLines(pi(e,s,p,i,l)),u=A(e.doc,M(i,0),M(l,N(e.doc,l).text.length));1o.ch&&v.charCodeAt(v.length-m-1)==x.charCodeAt(x.length-m-1);)h--,m++;c[c.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,''),c[0]=c[0].slice(h).replace(/\u200b+$/,'');var S=M(i,h),E=M(l,u.length?f(u).length-m:0);if(1Ii&&a.scrollbars.setScrollTop(a.scroller.scrollTop=d),null!=s.selectionStart){(!wi||wi&&9>Ii)&&e();var t=0,n=function(){a.selForContextMenu==r.doc.sel&&0==s.selectionStart&&0t++?a.detectingSelectAll=setTimeout(n,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(n,200)}}var o=this,r=o.cm,a=r.display,s=o.textarea,i=In(r,t),d=a.scroller.scrollTop;if(i&&!Ri){var l=r.options.resetSelectionOnContextMenu;l&&-1==r.doc.sel.contains(i)&&yo(r,Er)(r.doc,qo(i),Yi);var p=s.style.cssText,c=o.wrapper.style.cssText;o.wrapper.style.cssText='position: absolute';var u=o.wrapper.getBoundingClientRect();s.style.cssText='position: absolute; width: 30px; height: 30px;\n top: '+(t.clientY-u.top-5)+'px; left: '+(t.clientX-u.left-5)+'px;\n z-index: 1000; background: '+(wi?'rgba(255, 255, 255, .05)':'transparent')+';\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);';var h;if(Ni&&(h=window.scrollY),a.input.focus(),Ni&&window.scrollTo(null,h),a.input.reset(),r.somethingSelected()||(s.value=o.prevInput=' '),o.contextMenuPending=!0,a.selForContextMenu=r.doc.sel,clearTimeout(a.detectingSelectAll),wi&&9<=Ii&&e(),qi){Me(t);var m=function(){Ie(window,'mouseup',m),setTimeout(n,20)};ss(window,'mouseup',m)}else setTimeout(n,50)}},sd.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled='nocursor'==e},sd.prototype.setUneditable=function(){},sd.prototype.needsContentAttribute=!1,function(e){function t(t,o,r,a){e.defaults[t]=o,r&&(n[t]=a?function(e,t,n){n!=Zs&&r(e,t,n)}:r)}var n=e.optionHandlers;e.defineOption=t,e.Init=Zs,t('value','',function(e,t){return e.setValue(t)},!0),t('mode',null,function(e,t){e.doc.modeOption=t,Qo(e)},!0),t('indentUnit',2,Qo,!0),t('indentWithTabs',!1),t('smartIndent',!0),t('tabSize',4,function(e){Yo(e),nn(e),xo(e)},!0),t('lineSeparator',null,function(e,t){if(e.doc.lineSep=t,!!t){var n=[],o=e.doc.first;e.doc.iter(function(e){for(var r=0,a;;){if(a=e.text.indexOf(t,r),-1==a)break;r=a+t.length,n.push(M(o,a))}o++});for(var r=n.length-1;0<=r;r--)Ur(e.doc,t,n[r],M(n[r].line,n[r].ch+t.length))}}),t('specialChars',/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test('\t')?'':'|\t'),'g'),n!=Zs&&e.refresh()}),t('specialCharPlaceholder',pt,function(e){return e.refresh()},!0),t('electricChars',!0),t('inputStyle',Fi?'contenteditable':'textarea',function(){throw new Error('inputStyle can not (yet) be changed in a running editor')},!0),t('spellcheck',!1,function(e,t){return e.getInputField().spellcheck=t},!0),t('rtlMoveVisually',!Vi),t('wholeLineUpdateBefore',!0),t('theme','default',function(e){za(e),Ka(e)},!0),t('keyMap','default',function(e,t,n){var o=ha(t),r=n!=Zs&&ha(n);r&&r.detach&&r.detach(e,o),o.attach&&o.attach(e,r||null)}),t('extraKeys',null),t('configureMouse',null),t('lineWrapping',!1,Xa,!0),t('gutters',[],function(e){Bo(e.options),Ka(e)},!0),t('fixedGutter',!0,function(e,t){e.display.gutters.style.left=t?kn(e.display)+'px':'0',e.refresh()},!0),t('coverGutterNextToScrollbar',!1,function(e){return ro(e)},!0),t('scrollbarStyle','native',function(e){io(e),ro(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t('lineNumbers',!1,function(e){Bo(e.options),Ka(e)},!0),t('firstLineNumber',1,Ka,!0),t('lineNumberFormatter',function(e){return e},Ka,!0),t('showCursorWhenSelecting',!1,An,!0),t('resetSelectionOnContextMenu',!0),t('lineWiseCopyCut',!0),t('pasteLinesPerSelection',!0),t('readOnly',!1,function(e,t){'nocursor'==t&&(Bn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t('disableInput',!1,function(e,t){t||e.display.input.reset()},!0),t('dragDrop',!0,Ga),t('allowDropFileTypes',null),t('cursorBlinkRate',530),t('cursorScrollMargin',0),t('cursorHeight',1,An,!0),t('singleCursorHeightPerLine',!0,An,!0),t('workTime',100),t('workDelay',100),t('flattenSpans',!0,Yo,!0),t('addModeClass',!1,Yo,!0),t('pollInterval',100),t('undoDepth',200,function(e,t){return e.doc.history.undoDepth=t}),t('historyEventDelay',1250),t('viewportMargin',10,function(e){return e.refresh()},!0),t('maxHighlightLength',1e4,Yo,!0),t('moveInputWithCursor',!0,function(e,t){t||e.display.input.resetPosition()}),t('tabindex',null,function(e,t){return e.display.input.getField().tabIndex=t||''}),t('autofocus',null),t('direction','ltr',function(e,t){return e.doc.setDirection(t)},!0)}(Qa),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var o=this.options,r=o[e];o[e]==n&&'mode'!=e||(o[e]=n,t.hasOwnProperty(e)&&yo(this,t[e])(this,n,r),Ne(this,'optionChange',this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?'push':'unshift'](ha(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;no&&(Ja(t,a.head.line,e,!0),o=a.head.line,r==t.doc.sel.primIndex&&Qn(t))}),getTokenAt:function(e,t){return tt(this,e,t)},getLineTokens:function(e,t){return tt(this,M(e),t,!0)},getTokenTypeAt:function(e){e=q(this.doc,e);var t=Ye(this,N(this.doc,e.line)),n=0,o=(t.length-1)/2,r=e.ch,a;if(0==r)a=t[2];else for(;;){var i=n+o>>1;if((i?t[2*i-1]:0)>=r)o=i;else if(t[2*i+1]s?a:0==s?null:a.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var o=this,r=[];if(!n.hasOwnProperty(t))return r;var a=n[t],s=this.getModeAt(e);if('string'==typeof s[t])a[s[t]]&&r.push(a[s[t]]);else if(s[t])for(var d=0,i;da&&(e=a,o=!0),r=N(this.doc,e)}else r=e;return dn(this,r,{top:0,left:0},t||'page',n||o).top+(o?this.doc.height-xe(r):0)},defaultTextHeight:function(){return Cn(this.display)},defaultCharWidth:function(){return Sn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,o,r){var a=this.display;e=cn(this,q(this.doc,e));var i=e.bottom,s=e.left;if(t.style.position='absolute',t.setAttribute('cm-ignore-events','true'),this.display.input.setUneditable(t),a.sizer.appendChild(t),'over'==o)i=e.top;else if('above'==o||'near'==o){var d=fi(a.wrapper.clientHeight,this.doc.height),l=fi(a.sizer.clientWidth,a.lineSpace.clientWidth);('above'==o||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?i=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(i=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=i+'px',t.style.left=t.style.right='','right'==r?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right='0px'):('left'==r?s=0:'middle'==r&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+'px'),n&&Kn(this,{left:s,top:i,right:s+t.offsetWidth,bottom:i+t.offsetHeight})},triggerOnKeyDown:bo(Na),triggerOnKeyPress:bo(Ra),triggerOnKeyUp:La,triggerOnMouseDown:bo(Pa),execCommand:function(e){if(Qs.hasOwnProperty(e))return Qs[e].call(null,this)},triggerElectric:bo(function(e){ti(this,e)}),findPosH:function(e,t,n,o){var r=this,a=1;0>t&&(a=-1,t=-t);for(var s=q(this.doc,e),d=0;de?o.from():o.to()},$i)}),deleteH:bo(function(e,t){var n=this.doc.sel,o=this.doc;n.somethingSelected()?o.replaceSelection('',null,'+delete'):ma(this,function(n){var r=ai(o,n.head,e,t,!1);return 0>e?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(e,t,n,o){var r=this,a=1,s=o;0>t&&(a=-1,t=-t);for(var d=q(this.doc,e),l=0,i;le?i.from():i.to();var s=cn(n,i.head,'div');null!=i.goalColumn&&(s.left=i.goalColumn),r.push(s.left);var d=ii(n,s,e,t);return'page'==t&&i==o.sel.primary()&&Xn(n,pn(n,d,'div').top-s.top),d},$i),r.length)for(var s=0;sh(dd,ld)&&(Qa.prototype[ld]=function(e){return function(){return e.apply(this.doc,arguments)}}(Hs.prototype[ld]));return Oe(Hs),Qa.inputStyles={textarea:sd,contenteditable:id},Qa.defineMode=function(e){Qa.defaults.mode||'null'==e||(Qa.defaults.mode=e),He.apply(this,arguments)},Qa.defineMIME=function(e,t){hs[e]=t},Qa.defineMode('null',function(){return{token:function(e){return e.skipToEnd()}}}),Qa.defineMIME('text/plain','null'),Qa.defineExtension=function(e,t){Qa.prototype[e]=t},Qa.defineDocExtension=function(e,t){Hs.prototype[e]=t},Qa.fromTextArea=function(e,t){function n(){e.value=d.getValue()}if(t=t?c(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var o=s();t.autofocus=o==e||null!=e.getAttribute('autofocus')&&o==document.body}var r;if(e.form&&(ss(e.form,'submit',n),!t.leaveSubmitMethodAlone)){var a=e.form;r=a.submit;try{var i=a.submit=function(){n(),a.submit=r,a.submit(),a.submit=i}}catch(t){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display='',e.form&&(Ie(e.form,'submit',n),'function'==typeof e.form.submit&&(e.form.submit=r))}},e.style.display='none';var d=Qa(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return d},function(e){e.off=Ie,e.on=ss,e.wheelEventPixels=Vo,e.Doc=Hs,e.splitLines=ds,e.countColumn=u,e.findColumn=m,e.isWordChar=C,e.Pass=Qi,e.signal=Ne,e.Line=Cs,e.changeEnd=jo,e.scrollbarModel=Ls,e.Pos=M,e.cmpPos=F,e.modes=us,e.mimeModes=hs,e.resolveMode=qe,e.getMode=je,e.modeExtensions=ms,e.extendMode=ze,e.copyState=Ke,e.startState=Xe,e.innerMode=Ge,e.commands=Qs,e.keyMap=Xs,e.keyName=ua,e.isModifierKey=pa,e.lookupKey=la,e.normalizeKeyMap=da,e.StringStream=gs,e.SharedTextMarker=Vs,e.TextMarker=Us,e.LineWidget=Fs,e.e_preventDefault=Pe,e.e_stopPropagation=De,e.e_stop=Me,e.addClass=d,e.contains=a,e.rmClass=ji,e.keyNames=zs}(Qa),Qa.version='5.36.1',Qa}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){function t(e,t,o,r){var a=e.getLineHandle(t.line),d=t.ch-1,l=0<=d&&s[a.text.charAt(d)]||s[a.text.charAt(++d)];if(!l)return null;var p='>'==l.charAt(1)?1:-1;if(o&&0a))for(u==t.line&&(m=t.ch-(0>n?1:0));m!=g;m+=n){var f=h.charAt(m);if(p.test(f)&&(void 0===o||e.getTokenTypeAt(i(u,m+1))==o)){var y=s[f];if('>'==y.charAt(1)==0document.documentMode),i=e.Pos,s={"(":')>',")":'(<',"[":']>',"]":'[<',"{":'}>',"}":'{<'},d=null;e.defineOption('matchBrackets',!1,function(t,n,o){o&&o!=e.Init&&t.off('cursorActivity',r),n&&(t.state.matchBrackets='object'==typeof n?n:{},t.on('cursorActivity',r))}),e.defineExtension('matchBrackets',function(){o(this,!0)}),e.defineExtension('findMatchingBracket',function(e,n,o){return t(this,e,n,o)}),e.defineExtension('scanForBracket',function(e,t,o,r){return n(this,e,t,o,r)})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror'),require('../fold/xml-fold')):'function'==typeof define&&define.amd?define(['../../lib/codemirror','../fold/xml-fold'],e):e(CodeMirror)}(function(e){'use strict';function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var o=n.getCursor(),r=n.getViewport();r.from=Math.min(r.from,o.line),r.to=Math.max(o.line+1,r.to);var a=e.findMatchingTag(n,o,r);if(a){if(n.state.matchBothTags){var i='open'==a.at?a.open:a.close;i&&(n.state.tagHit=n.markText(i.from,i.to,{className:'CodeMirror-matchingtag'}))}var s='close'==a.at?a.open:a.close;s?n.state.tagOther=n.markText(s.from,s.to,{className:'CodeMirror-matchingtag'}):n.state.failedTagMatch=!0}}})}function o(e){e.state.failedTagMatch&&n(e)}e.defineOption('matchTags',!1,function(r,a,i){i&&i!=e.Init&&(r.off('cursorActivity',n),r.off('viewportChange',o),t(r)),a&&(r.state.matchBothTags='object'==typeof a&&a.bothTags,r.on('cursorActivity',n),r.on('viewportChange',o),n(r))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var o='close'==n.at?n.open:n.close;o&&t.extendSelection(o.to,o.from)}}}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){function t(e,t){return'pairs'==t&&'string'==typeof e?e:'object'==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return d(t,e)}}function o(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function r(n){var r=o(n);if(!r||n.getOption('disableInput'))return e.Pass;for(var a=t(r,'pairs'),s=n.listSelections(),d=0;d=x.ch||n.getRange(h(x.line,x.ch-3),h(x.line,x.ch-2))!=r))C='addFour';else if(m){if(!e.isWordChar(i)&&c(n,x,r))C='both';else return e.Pass;}else if(f&&(n.getLine(x.line).length==x.ch||l(i,d)||/\s/.test(i)))C='both';else return e.Pass;if(!b)b=C;else if(b!=C)return e.Pass}var S=p%2?d.charAt(p-1):r,E=p%2?r:d.charAt(p+1);n.operation(function(){if('skip'==b)n.execCommand('goCharRight');else if('skipThree'==b)for(var e=0;3>e;e++)n.execCommand('goCharRight');else if('surround'==b){for(var t=n.getSelections(),e=0;e=n.ch+1)return /\bstring2?\b/.test(s);i.start=i.pos}}var u={pairs:'()[]{}\'\'""',triples:'',explode:'[]{}'},h=e.Pos;e.defineOption('autoCloseBrackets',!1,function(t,n,o){o&&o!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var m=u.pairs+'`',g={Backspace:r,Enter:a},f=0;fi.ch&&(y=y.slice(0,y.length-p.end+i.ch));var b=y.toLowerCase();if(!y||'string'==p.type&&(p.end!=i.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||1==p.string.length)||'tag'==p.type&&'closeTag'==u.type||p.string.indexOf('/')==p.string.length-1||g&&-1'+(v?'\n\n':'')+'',newPos:v?e.Pos(i.line+1,0):e.Pos(i.line,i.ch+1)}}for(var l=n.length-1,x;0<=l;l--){x=o[l],t.replaceRange(x.text,n[l].head,n[l].anchor,'+insert');var C=t.listSelections().slice(0);C[l]={head:x.newPos,anchor:x.newPos},t.setSelections(C),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],s=n?'/':''!=t.getLine(i.line).charAt(l.end)&&(u+='>'),r[d]=u}t.replaceSelections(r),o=t.listSelections();for(var d=0;d\'']=function(e){return t(e)}),n.addKeyMap(i)}});var s=['area','base','br','col','command','embed','hr','img','input','keygen','link','meta','param','source','track','wbr'],d=['applet','blockquote','body','button','div','dl','fieldset','form','frameset','h1','h2','h3','h4','h5','h6','head','html','iframe','layer','legend','object','ol','p','select','table','ul'];e.commands.closeTag=function(e){return n(e)}}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';function t(e){var t=e.search(a);return-1==t?0:t}function n(e,t,n){return /\bstring\b/.test(e.getTokenTypeAt(s(t.line,0)))&&!/^[\'\"`]/.test(n)}var o=Math.min,r={},a=/[^\s\u00a0]/,s=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension('toggleComment',function(e){e||(e=r);for(var t=this,n=Infinity,o=this.listSelections(),a=null,d=o.length-1;0<=d;d--){var i=o[d].from(),l=o[d].to();i.line>=n||(l.line>=n&&(l=s(n,0)),n=i.line,null==a?t.uncomment(i,l,e)?a='un':(t.lineComment(i,l,e),a='line'):'un'==a?t.uncomment(i,l,e):t.lineComment(i,l,e))}}),e.defineExtension('lineComment',function(e,i,d){d||(d=r);var l=this,p=l.getModeAt(e),c=l.getLine(e.line);if(!(null==c||n(l,e,c))){var u=d.lineComment||p.lineComment;if(!u)return void((d.blockCommentStart||p.blockCommentStart)&&(d.fullLines=!0,l.blockComment(e,i,d)));var h=o(0!=i.ch||i.line==e.line?i.line+1:i.line,l.lastLine()+1),m=null==d.padding?' ':d.padding,g=d.commentBlankLines||e.line==i.line;l.operation(function(){if(d.indent){for(var n=null,o=e.line;oi.length)&&(n=i)}for(var o=e.line;ou||d.operation(function(){if(!1!=n.fullLines){var o=a.test(d.getLine(u));d.replaceRange(h+c,s(u)),d.replaceRange(p+h,s(e.line,0));var r=n.blockCommentLead||l.blockCommentLead;if(null!=r)for(var m=e.line+1;m<=u;++m)(m!=u||o)&&d.replaceRange(r+h,s(m,0))}else d.replaceRange(c,t),d.replaceRange(p,e)})}),e.defineExtension('uncomment',function(e,t,n){n||(n=r);var d=this,l=d.getModeAt(e),p=o(0!=t.ch||t.line==e.line?t.line:t.line-1,d.lastLine()),c=o(e.line,p),u=n.lineComment||l.lineComment,h=[],m=null==n.padding?' ':n.padding,g;lineComment:{if(!u)break lineComment;for(var f=c;f<=p;++f){var i=d.getLine(f),y=i.indexOf(u);if(-1n||(t.slice(o,o+m.length)==m&&(o+=m.length),g=!0,d.replaceRange('',s(e,n),s(e,o)))}}),g)return!0}var b=n.blockCommentStart||l.blockCommentStart,v=n.blockCommentEnd||l.blockCommentEnd;if(!b||!v)return!1;var x=n.blockCommentLead||l.blockCommentLead,C=d.getLine(c),S=p==c?C:d.getLine(p),E=C.indexOf(b),k=S.lastIndexOf(v);if(-1==k&&c!=p&&(S=d.getLine(--p),k=S.lastIndexOf(v)),-1==E||-1==k||!/comment/.test(d.getTokenTypeAt(s(c,E+1)))||!/comment/.test(d.getTokenTypeAt(s(p,k+1))))return!1;var T=C.lastIndexOf(b,e.ch),w=-1==T?-1:C.slice(0,e.ch).indexOf(v,T+b.length);if(-1!=T&&-1!=w&&w+v.length!=e.ch)return!1;w=S.indexOf(v,t.ch);var I=S.slice(t.ch).lastIndexOf(b,w-t.ch);return(T=-1==w||-1==I?-1:t.ch+I,-1==w||-1==T||T==t.ch)&&(d.operation(function(){d.replaceRange('',s(p,k-(m&&S.slice(k-m.length,k)==m?m.length:0)),s(p,k+v.length));var e=E+b.length;if(m&&C.slice(e,e+m.length)==m&&(e+=m.length),d.replaceRange('',s(c,E),s(c,e)),x)for(var t=c+1;t<=p;++t){var n=d.getLine(t),o=n.indexOf(x);if(!(-1==o||a.test(n.slice(0,o)))){var r=o+x.length;m&&n.slice(r,r+m.length)==m&&(r+=m.length),d.replaceRange('',s(t,o),s(t,r))}}}),!0)})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(t){'use strict';function e(e,r,a,s){function i(t){var n=d(e,r);if(!n||n.to.line-n.from.linee.firstLine();)r=t.Pos(r.line-1,0),p=i(!1);if(p&&!p.cleared&&'unfold'!==s){var c=n(e,a);t.on(c,'mousedown',function(n){u.clear(),t.e_preventDefault(n)});var u=e.markText(p.from,p.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});u.on('clear',function(n,o){t.signal(e,'unfold',e,n,o)}),t.signal(e,'fold',e,p.from,p.to)}}function n(e,t){var n=o(e,t,'widget');if('string'==typeof n){var r=document.createTextNode(n);n=document.createElement('span'),n.appendChild(r),n.className='CodeMirror-foldmarker'}return n}function o(e,t,n){if(t&&t[n]!==void 0)return t[n];var o=e.options.foldOptions;return o&&void 0!==o[n]?o[n]:r[n]}t.newFoldFunction=function(t,n){return function(o,r){e(o,r,{rangeFinder:t,widget:n})}},t.defineExtension('foldCode',function(t,n,o){e(this,t,n,o)}),t.defineExtension('isFolded',function(e){for(var t=this.findMarksAt(e),n=0;n=s&&(n=r(a.indicatorOpen))}e.setGutterMarker(t,a.gutter,n),++i})}function i(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){a(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function s(e,t,n){var r=e.state.foldGutter;if(r){var a=r.options;if(n==a.gutter){var i=o(e,t);i?i.clear():e.foldCode(c(t,0),a.rangeFinder)}}}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){i(e)},n.foldOnChangeTimeSpan||600)}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||20t.to&&(a(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var o=t.line;o>=n.from&&o=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function s(e){for(;;){var t=e.text.indexOf('>',e.ch);if(-1==t)if(r(e))continue;else return;if(!o(e,t+1)){e.ch=t+1;continue}var n=e.text.lastIndexOf('/',t),a=-1',e.ch-1):-1;if(-1==t)if(a(e))continue;else return;if(!o(e,t+1)){e.ch=t;continue}var n=e.text.lastIndexOf('/',t),r=-1p&&(!t||t==o[2]))return{tag:o[2],from:u(r,a),to:u(e.line,e.ch)}}else n.push(o[2])}}function c(e,t){for(var n=[];;){var o=p(e);if(!o)return;if('selfClose'==o){d(e);continue}var r=e.line,a=e.ch,s=d(e);if(!s)return;if(s[1])n.push(s[2]);else{for(var l=n.length-1;0<=l;--l)if(n[l]==s[2]){n.length=l;break}if(0>l&&(!t||t==s[2]))return{tag:s[2],from:u(e.line,e.ch),to:u(r,a)}}}}var u=e.Pos,h=/<(\/?)([A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD-:.0-9\u00B7\u0300-\u036F\u203F-\u2040]*)/g;e.registerHelper('fold','xml',function(e,t){for(var o=new n(e,t.line,0);;){var r=l(o),a;if(!r||o.line!=t.line||!(a=s(o)))return;if(!r[1]&&'selfClose'!=a){var t=u(o.line,o.ch),d=i(o,r[2]);return d&&{from:t,to:d.from}}}}),e.findMatchingTag=function(e,o,r){var a=new n(e,o.line,o.ch,r);if(-1!=a.text.indexOf('>')||-1!=a.text.indexOf('<')){var l=s(a),p=l&&u(a.line,a.ch),h=l&&d(a);if(l&&h&&!(0s)d=l;else if(!/\S/.test(p));else break}if(d)return{from:e.Pos(n.line,r.length),to:e.Pos(d,t.getLine(d).length)}}})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';e.registerGlobalHelper('fold','comment',function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,a=o.blockCommentEnd;if(r&&a){for(var s=n.line,d=t.getLine(s),l=n.ch,p=0,c,u;;){if(u=0>=l?-1:d.lastIndexOf(r,l-1),-1==u){if(1==p)return;p=1,l=d.length;continue}if(1==p&&uv&&(v=i.length),0>x&&(x=i.length),b=Math.min(v,x),b==i.length)break;if(b==v)++h;else if(! --h){g=y,f=b;break outer}++b}return null==g||s==g&&f==c?void 0:{from:e.Pos(s,c),to:e.Pos(g,f)}}})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(t){'use strict';var n=Math.min;t.registerHelper('fold','brace',function(e,o){function r(n){for(var r=o.ch,i=0,d;;){if(d=0>=r?-1:s.lastIndexOf(n,r-1),-1==d){if(1==i)break;i=1,r=s.length;continue}if(1==i&&db&&(b=i.length),0>v&&(v=i.length),y=n(b,v),y==i.length)break;if(e.getTokenTypeAt(t.Pos(f,y+1))==c)if(y==b)++u;else if(! --u){m=f,g=y;break outer}++y}return null==m||a==m&&g==p?void 0:{from:t.Pos(a,p),to:t.Pos(m,g)}}}),t.registerHelper('fold','import',function(o,e){function r(r){if(ro.lastLine())return null;var a=o.getTokenAt(t.Pos(r,1));if(/\S/.test(a.string)||(a=o.getTokenAt(t.Pos(r,a.end+1))),'keyword'!=a.type||'import'!=a.string)return null;for(var s=r,i=n(o.lastLine(),r+10);s<=i;++s){var e=o.getLine(s),d=e.indexOf(';');if(-1!=d)return{startCh:a.end,end:t.Pos(s,d)}}}var e=e.line,a=r(e),i;if(!a||r(e-1)||(i=r(e-2))&&i.end.line==e-1)return null;for(var s=a.end,d;;){if(d=r(s.line+1),null==d)break;s=d.end}return{from:o.clipPos(t.Pos(e,a.startCh+1)),to:s}}),t.registerHelper('fold','include',function(e,n){function o(n){if(ne.lastLine())return null;var o=e.getTokenAt(t.Pos(n,1));if(/\S/.test(o.string)||(o=e.getTokenAt(t.Pos(n,o.end+1))),'meta'==o.type&&'#include'==o.string.slice(0,8))return o.start+8}var n=n.line,r=o(n);if(null==r||null!=o(n-1))return null;for(var a=n,i;;){if(i=o(a+1),null==i)break;++a}return{from:t.Pos(n,r+1),to:e.clipPos(t.Pos(a))}})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror'),'cjs'):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],function(t){e(t,'amd')}):e(CodeMirror,'plain')}(function(e,t){function n(e,t){var n=t;return function(){0==--n&&e()}}function o(t,o){var r=e.modes[t].dependencies;if(!r)return o();for(var a=[],s=0;sS){d.style.height=S-5+'px',d.style.top=(v=y.bottom-E.top)+'px';var I=s.getCursor();t.from.ch!=I.ch&&(y=s.cursorCoords(I),d.style.left=(b=y.left)+'px',E=d.getBoundingClientRect())}}var N=E.right-C;if(0C&&(d.style.width=C-5+'px',N-=E.right-E.left-C),d.style.left=(b=y.left-N)+'px'),s.addKeyMap(this.keyMap=a(n,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:l.length,close:function(){n.close()},pick:function(){o.pick()},data:t})),n.options.closeOnUnfocus){var A;s.on('blur',this.onBlur=function(){A=setTimeout(function(){n.close()},100)}),s.on('focus',this.onFocus=function(){clearTimeout(A)})}var L=s.getScrollInfo();return s.on('scroll',this.onScroll=function(){var e=s.getScrollInfo(),t=s.getWrapperElement().getBoundingClientRect(),o=v+L.top-e.top,r=o-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return x||(r+=d.offsetHeight),r<=t.top||r>=t.bottom?n.close():void(d.style.top=o+'px',d.style.left=b+L.left-e.left+'px')}),e.on(d,'dblclick',function(n){var e=i(d,n.target||n.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),o.pick())}),e.on(d,'click',function(r){var e=i(d,r.target||r.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),n.options.completeOnSingleClick&&o.pick())}),e.on(d,'mousedown',function(){setTimeout(function(){s.focus()},20)}),e.signal(t,'select',l[0],d.firstChild),!0}function d(e,t){if(!e.somethingSelected())return t;for(var n=[],o=0;o=this.data.list.length?t=n?this.data.list.length-1:0:0>t&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var o=this.hints.childNodes[this.selectedHint];o.className=o.className.replace(' '+u,''),o=this.hints.childNodes[this.selectedHint=t],o.className+=' '+u,o.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=o.offsetTop+o.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,'select',this.data.list[this.selectedHint],o)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper('hint','auto',{resolve:function(t,n){var o=t.getHelpers(n,'hint'),r;if(o.length){var a=function(e,t,n){function r(o){return o==a.length?t(null):void l(a[o],e,n,function(e){e&&0,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption('hintOptions',null)}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){function t(t,n){for(var o=0,r=t.length;os.ch&&(d.end=s.ch,d.string=d.string.slice(0,s.ch-d.start)):d={start:s.ch,end:s.ch,string:'',state:d.state,type:'.'==d.string?'property':null};for(var l=d;'property'==l.type;){if(l=o(t,i(s.line,l.start)),'.'!=l.string)return;if(l=o(t,i(s.line,l.start)),!p)var p=[];p.push(l)}return{list:a(d,p,n,r),from:i(s.line,d.start),to:i(s.line,d.end)}}}function r(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&'.'==n.string.charAt(0)?(n.end=n.start,n.string='.',n.type='property'):/^\.[\w$_]*$/.test(n.string)&&(n.type='property',n.start++,n.string=n.string.replace(/\./,'')),n}function a(e,o,r,a){function i(e){0!=e.lastIndexOf(u,0)||n(c,e)||c.push(e)}function p(e){for(var n in'string'==typeof e?t(s,i):e instanceof Array?t(d,i):e instanceof Function&&t(l,i),e)i(n)}var c=[],u=e.string,h=a&&a.globalScope||window;if(o&&o.length){var m=o.pop(),g;for(m.type&&0===m.type.indexOf('variable')?(a&&a.additionalContext&&(g=a.additionalContext[m.string]),(!a||!1!==a.useGlobalScope)&&(g=g||h[m.string])):'string'==m.type?g='':'atom'==m.type?g=1:'function'==m.type&&(null!=h.jQuery&&('$'==m.string||'jQuery'==m.string)&&'function'==typeof h.jQuery?g=h.jQuery():null!=h._&&'_'==m.string&&'function'==typeof h._&&(g=h._()));null!=g&&o.length;)g=g[o.pop().string];null!=g&&p(g)}else{for(var f=e.state.localVars;f;f=f.next)i(f.name);for(var f=e.state.globalVars;f;f=f.next)i(f.name);a&&!1===a.useGlobalScope||p(h),t(r,i)}return c}var i=e.Pos;e.registerHelper('hint','javascript',function(e,t){return o(e,p,function(t,e){return t.getTokenAt(e)},t)}),e.registerHelper('hint','coffeescript',function(e,t){return o(e,c,r,t)});var s='charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search'.split(' '),d='length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight '.split(' '),l=['prototype','apply','call','bind'],p='break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with'.split(' '),c='and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes'.split(' ')}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';var t=Math.max,o=e.Pos;e.registerHelper('hint','xml',function(r,a){var s=a&&a.schemaInfo,d=a&&a.quoteChar||'"';if(s){var l=r.getCursor(),p=r.getTokenAt(l);p.end>l.ch&&(p.end=l.ch,p.string=p.string.slice(0,l.ch-p.start));var c=e.innerMode(r.getMode(),p.state);if('xml'==c.mode.name){var u=[],h=!1,m=/\btag\b/.test(p.type)&&!/>$/.test(p.string),g=m&&/^\w/.test(p.string),f,y;if(g){var b=r.getLine(l.line).slice(t(0,p.start-2),p.start),v=/<\/$/.test(b)?'close':/<$/.test(b)?'open':null;v&&(y=p.start-('close'==v?2:1))}else m&&'<'==p.string?v='open':m&&'')}else{var C=s[c.state.tagName],k=C&&C.attrs,T=s['!attrs'];if(!k&&!T)return;if(!k)k=T;else if(T){var w={};for(var I in T)T.hasOwnProperty(I)&&(w[I]=T[I]);for(var I in k)k.hasOwnProperty(I)&&(w[I]=k[I]);k=w}if('string'==p.type||'='==p.string){var b=r.getRange(o(l.line,t(0,l.ch-60)),o(l.line,'string'==p.type?p.start:p.end)),N=b.match(/([^\s\u00a0=<>\"\']+)=$/),A;if(!N||!k.hasOwnProperty(N[1])||!(A=k[N[1]]))return;if('function'==typeof A&&(A=A.call(this,r)),'string'==p.type){f=p.string;var L=0;/['"]/.test(p.string.charAt(0))&&(d=p.string.charAt(0),f=p.string.slice(1),L++);var n=p.string.length;/['"]/.test(p.string.charAt(n-1))&&(d=p.string.charAt(n-1),f=p.string.substr(L,n-2)),h=!0}for(var E=0;E][<][=] [X]','device-aspect-ratio: X/Y','orientation:portrait','orientation:landscape','device-height: [X]','device-width: [X]'],l={attrs:{}},p={a:{attrs:{href:null,ping:null,type:null,media:d,target:o,hreflang:n}},abbr:l,acronym:l,address:l,applet:l,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:d,hreflang:n,type:null,shape:['default','rect','circle','poly']}},article:l,aside:l,audio:{attrs:{src:null,mediagroup:null,crossorigin:['anonymous','use-credentials'],preload:['none','metadata','auto'],autoplay:['','autoplay'],loop:['','loop'],controls:['','controls']}},b:l,base:{attrs:{href:null,target:o}},basefont:l,bdi:l,bdo:l,big:l,blockquote:{attrs:{cite:null}},body:l,br:l,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:['','autofocus'],disabled:['','autofocus'],formenctype:i,formmethod:a,formnovalidate:['','novalidate'],formtarget:o,type:['submit','reset','button']}},canvas:{attrs:{width:null,height:null}},caption:l,center:l,cite:l,code:l,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:['command','checkbox','radio'],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:['','disabled'],checked:['','checked']}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:['','disabled'],multiple:['','multiple']}},datalist:{attrs:{data:null}},dd:l,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:['','open']}},dfn:l,dir:l,div:l,dl:l,dt:l,em:l,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:['','disabled'],form:null,name:null}},figcaption:l,figure:l,font:l,footer:l,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:['on','off'],enctype:i,method:a,novalidate:['','novalidate'],target:o}},frame:l,frameset:l,h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,head:{attrs:{},children:['title','base','link','style','meta','script','noscript','command']},header:l,hgroup:l,hr:l,html:{attrs:{manifest:null},children:['head','body']},i:l,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:['allow-top-navigation','allow-same-origin','allow-forms','allow-scripts'],seamless:['','seamless']}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:['anonymous','use-credentials']}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:['audio/*','video/*','image/*'],autocomplete:['on','off'],autofocus:['','autofocus'],checked:['','checked'],disabled:['','disabled'],formenctype:i,formmethod:a,formnovalidate:['','novalidate'],formtarget:o,multiple:['','multiple'],readonly:['','readonly'],required:['','required'],type:['hidden','text','search','tel','url','email','password','datetime','date','month','week','time','datetime-local','number','range','color','checkbox','radio','file','submit','image','reset','button']}},ins:{attrs:{cite:null,datetime:null}},kbd:l,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:['','autofocus'],disabled:['','disabled'],keytype:['RSA']}},label:{attrs:{for:null,form:null}},legend:l,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:n,media:d,sizes:['all','16x16','16x16 32x32','16x16 32x32 64x64']}},map:{attrs:{name:null}},mark:l,menu:{attrs:{label:null,type:['list','context','toolbar']}},meta:{attrs:{content:null,charset:r,name:['viewport','application-name','author','description','generator','keywords'],"http-equiv":['content-language','content-type','default-style','refresh']}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:l,noframes:l,noscript:l,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:['','typemustmatch']}},ol:{attrs:{reversed:['','reversed'],start:null,type:['1','a','A','i','I']}},optgroup:{attrs:{disabled:['','disabled'],label:null}},option:{attrs:{disabled:['','disabled'],label:null,selected:['','selected'],value:null}},output:{attrs:{for:null,form:null,name:null}},p:l,param:{attrs:{name:null,value:null}},pre:l,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:l,rt:l,ruby:l,s:l,samp:l,script:{attrs:{type:['text/javascript'],src:null,async:['','async'],defer:['','defer'],charset:r}},section:l,select:{attrs:{form:null,name:null,size:null,autofocus:['','autofocus'],disabled:['','disabled'],multiple:['','multiple']}},small:l,source:{attrs:{src:null,type:null,media:null}},span:l,strike:l,strong:l,style:{attrs:{type:['text/css'],media:d,scoped:null}},sub:l,summary:l,sup:l,table:l,tbody:l,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:['','autofocus'],disabled:['','disabled'],readonly:['','readonly'],required:['','required'],wrap:['soft','hard']}},tfoot:l,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:['row','col','rowgroup','colgroup']}},thead:l,time:{attrs:{datetime:null}},title:l,tr:l,track:{attrs:{src:null,label:null,default:null,kind:['subtitles','captions','descriptions','chapters','metadata'],srclang:n}},tt:l,u:l,ul:l,var:l,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:['anonymous','use-credentials'],preload:['auto','metadata','none'],autoplay:['','autoplay'],mediagroup:['movie'],muted:['','muted'],controls:['','controls']}},wbr:l},c={accesskey:['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'],class:null,contenteditable:['true','false'],contextmenu:null,dir:['ltr','rtl','auto'],draggable:['true','false','auto'],dropzone:['copy','move','link','string:','file:'],hidden:['hidden'],id:null,inert:['inert'],itemid:null,itemprop:null,itemref:null,itemscope:['itemscope'],itemtype:null,lang:['en','es'],spellcheck:['true','false'],style:null,tabindex:['1','2','3','4','5','6','7','8','9'],title:null,translate:['yes','no'],onclick:null,rel:['stylesheet','alternate','author','bookmark','help','license','next','nofollow','noreferrer','prefetch','prev','search','tag']};for(var u in t(l),p)p.hasOwnProperty(u)&&p[u]!=l&&t(p[u]);e.htmlSchema=p,e.registerHelper('hint','html',function(t,n){var o={schemaInfo:p};if(n)for(var r in n)o[r]=n[r];return e.hint.xml(t,o)})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror'),require('../../mode/css/css')):'function'==typeof define&&define.amd?define(['../../lib/codemirror','../../mode/css/css'],e):e(CodeMirror)}(function(e){'use strict';var t={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper('hint','css',function(n){function o(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||c.push(t)}var r=n.getCursor(),a=n.getTokenAt(r),i=e.innerMode(n.getMode(),a.state);if('css'==i.mode.name){if('keyword'==a.type&&0=='!important'.indexOf(a.string))return{list:['!important'],from:e.Pos(r.line,a.start),to:e.Pos(r.line,a.end)};var s=a.start,d=r.ch,l=a.string.slice(0,d-s);/[^\w$_-]/.test(l)&&(l='',s=d=r.ch);var p=e.resolveMode('text/css'),c=[],u=i.state.state;if('pseudo'==u||'variable-3'==a.type?o(t):'block'==u||'maybeprop'==u?o(p.propertyKeywords):'prop'==u||'parens'==u||'at'==u||'params'==u?(o(p.valueKeywords),o(p.colorKeywords)):('media'==u||'media_parens'==u)&&(o(p.mediaTypes),o(p.mediaFeatures)),c.length)return{list:c,from:e.Pos(r.line,s),to:e.Pos(r.line,d)}}})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';function t(e){for(var t=0;te.lastLine())){var i=e.getLine(n.line),u=i.length-l[0].length;if(s(i.slice(u))==d[0]){for(var h=o(n.line,u),p=n.line+1,c=1;cn)--o;else return o}var o=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=o(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=o(r.line-1,this.doc.getLine(r.line-1).length)}else{var a=this.doc.lineCount();if(r.line==a-1)return t(a);r=o(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=o(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension('getSearchCursor',function(e,n,o){return new t(this.doc,e,n,o)}),e.defineDocExtension('getSearchCursor',function(e,n,o){return new t(this,e,n,o)}),e.defineExtension('selectMatches',function(t,n){for(var o=[],r=this.getSearchCursor(t,this.getCursor('from'),n);r.findNext()&&!(0n.line&&document.querySelector&&(o=t.display.wrapper.querySelector('.CodeMirror-dialog'))&&o.getBoundingClientRect().bottom-4>t.cursorCoords(n,'window').top&&((l=o).style.opacity=.4)}))})}else s(t,y,'Search for:',d,function(e){e&&!a.query&&t.operation(function(){c(t,a,e),a.posFrom=a.posTo=t.getCursor(),h(t,n)})})}function h(t,n,r){t.operation(function(){var i=o(t),s=a(t,i.query,n?i.posFrom:i.posTo);!s.find(n)&&(s=a(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),!s.find(n))||(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),i.posFrom=s.from(),i.posTo=s.to(),r&&r(s.from(),s.to()))})}function m(e){e.operation(function(){var t=o(e);t.lastQuery=t.query;t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function g(e,t,n){e.operation(function(){for(var o=a(e,t);o.findNext();)if('string'!=typeof t){var r=e.getRange(o.from(),o.to()).match(t);o.replace(n.replace(/\$(\d)/g,function(e,t){return r[t]}))}else o.replace(n)})}function f(e,t){if(!e.getOption('readOnly')){var n=e.getSelection()||o(e).lastQuery,r=t?'Replace all:':'Replace:';s(e,r+b,r,n,function(n){n&&(n=p(n),s(e,v,'Replace with:','',function(o){if(o=l(o),t)g(e,n,o);else{m(e);var r=a(e,n,e.getCursor('from')),i=function(){var t=r.from(),l;!(l=r.findNext())&&(r=a(e,n),!(l=r.findNext())||t&&r.from().line==t.line&&r.from().ch==t.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),d(e,x,'Replace?',[function(){s(l)},i,function(){g(e,n,o)}]))},s=function(e){r.replace('string'==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),i()};i()}}))})}}var y='Search: (Use /re/ syntax for regexp search)',b=' (Use /re/ syntax for regexp search)',v='With: ',x='Replace? ';e.commands.find=function(e){m(e),u(e)},e.commands.findPersistent=function(e){m(e),u(e,!1,!0)},e.commands.findNext=u,e.commands.findPrev=function(e){u(e,!0)},e.commands.clearSearch=m,e.commands.replace=f,e.commands.replaceAll=function(e){f(e,!0)}}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(t){function e(e,t,n){var o=e.getWrapperElement(),r;return r=o.appendChild(document.createElement('div')),r.className=n?'CodeMirror-dialog CodeMirror-dialog-bottom':'CodeMirror-dialog CodeMirror-dialog-top','string'==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}t.defineExtension('openDialog',function(o,r,a){function i(e){if('string'==typeof e)p.value=e;else{if(d)return;d=!0,s.parentNode.removeChild(s),l.focus(),a.onClose&&a.onClose(s)}}a||(a={}),n(this,null);var s=e(this,o,a.bottom),d=!1,l=this,p=s.getElementsByTagName('input')[0],c;return p?(p.focus(),a.value&&(p.value=a.value,!1!==a.selectValueOnOpen&&p.select()),a.onInput&&t.on(p,'input',function(t){a.onInput(t,p.value,i)}),a.onKeyUp&&t.on(p,'keyup',function(t){a.onKeyUp(t,p.value,i)}),t.on(p,'keydown',function(n){a&&a.onKeyDown&&a.onKeyDown(n,p.value,i)||((27==n.keyCode||!1!==a.closeOnEnter&&13==n.keyCode)&&(p.blur(),t.e_stop(n),i()),13==n.keyCode&&r(p.value,n))}),!1!==a.closeOnBlur&&t.on(p,'blur',i)):(c=s.getElementsByTagName('button')[0])&&(t.on(c,'click',function(){i(),l.focus()}),!1!==a.closeOnBlur&&t.on(c,'blur',i),c.focus()),i}),t.defineExtension('openConfirm',function(o,r,a){function s(){p||(p=!0,d.parentNode.removeChild(d),c.focus())}n(this,null);var d=e(this,o,a&&a.bottom),l=d.getElementsByTagName('button'),p=!1,c=this,u=1;l[0].focus();for(var h=0,i;h=u&&s()},200)}),t.on(i,'focus',function(){++u})}),t.defineExtension('openNotification',function(o,r){function a(){s||(s=!0,clearTimeout(l),i.parentNode.removeChild(i))}n(this,a);var i=e(this,o,r&&r.bottom),s=!1,d=r&&'undefined'!=typeof r.duration?r.duration:5e3,l;return t.on(i,'click',function(n){t.e_preventDefault(n),a()}),d&&(l=setTimeout(a,d)),a})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror'),require('../dialog/dialog')):'function'==typeof define&&define.amd?define(['../../lib/codemirror','../dialog/dialog'],e):e(CodeMirror)}(function(e){'use strict';function t(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0}):r(prompt(n,o))}function n(e,t){var n=+t;return /^[-+]/.test(t)?e.getCursor().line+n:n-1}e.commands.jumpToLine=function(e){var o=e.getCursor();t(e,'Jump to line: (Use line:column or scroll% syntax)','Jump to line:',o.line+1+':'+o.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),+r[2]);else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var a=Math.round(e.lineCount()*+r[1]/100);/^[-+]/.test(r[1])&&(a=o.line+a+1),e.setCursor(a-1,o.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),o.ch)}})},e.keyMap['default']['Alt-G']='jumpToLine'}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode('xml',function(o,r){function a(e,t){function n(n){return t.tokenize=n,n(e,t)}var o=e.next();if('<'==o)return e.eat('!')?e.eat('[')?e.match('CDATA[')?n(d('atom',']]>')):null:e.match('--')?n(d('comment','-->')):e.match('DOCTYPE',!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat('?')?(e.eatWhile(/[\w\._\-]/),t.tokenize=d('meta','?>'),'meta'):(w=e.eat('/')?'closeTag':'openTag',t.tokenize=i,'tag bracket');if('&'==o){var r;return r=e.eat('#')?e.eat('x')?e.eatWhile(/[a-fA-F\d]/)&&e.eat(';'):e.eatWhile(/[\d]/)&&e.eat(';'):e.eatWhile(/[\w\.\-:]/)&&e.eat(';'),r?'atom':'error'}return e.eatWhile(/[^&<]/),null}function i(e,t){var n=e.next();if('>'==n||'/'==n&&e.eat('>'))return t.tokenize=a,w='>'==n?'endTag':'selfcloseTag','tag bracket';if('='==n)return w='equals',null;if('<'==n){t.tokenize=a,t.state=h,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+' tag error':'tag error'}return /[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),'word')}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return'string'};return t.isInAttribute=!0,t}function d(e,t){return function(n,o){for(;!n.eol();){if(n.match(t)){o.tokenize=a;break}n.next()}return e}}function l(e){return function(t,n){for(var o;null!=(o=t.next());){if('<'==o)return n.tokenize=l(e+1),n.tokenize(t,n);if('>'==o)if(1==e){n.tokenize=a;break}else return n.tokenize=l(e-1),n.tokenize(t,n)}return'meta'}}function p(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(E.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!E.contextGrabbers.hasOwnProperty(n)||!E.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function h(e,t,n){return'openTag'==e?(n.tagStart=t.column(),m):'closeTag'==e?g:h}function m(e,t,n){return'word'==e?(n.tagName=t.current(),I='tag',b):(I='error',m)}function g(e,t,n){if('word'==e){var o=t.current();return n.context&&n.context.tagName!=o&&E.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==o||!1===E.matchClosing?(I='tag',f):(I='tag error',y)}return I='error',y}function f(e,t,n){return'endTag'==e?(c(n),h):(I='error',f)}function y(e,t,n){return I='error',f(e,t,n)}function b(e,t,n){if('word'==e)return I='attribute',v;if('endTag'==e||'selfcloseTag'==e){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,'selfcloseTag'==e||E.autoSelfClosers.hasOwnProperty(o)?u(n,o):(u(n,o),n.context=new p(n,o,r==n.indented)),h}return I='error',b}function v(e,t,n){return'equals'==e?x:(E.allowMissing||(I='error'),b(e,t,n))}function x(e,t,n){return'string'==e?C:'word'==e&&E.allowUnquoted?(I='string',b):(I='error',b(e,t,n))}function C(e,t,n){return'string'==e?C:b(e,t,n)}var S=o.indentUnit,E={},k=r.htmlMode?t:n;for(var T in k)E[T]=k[T];for(var T in r)E[T]=r[T];var w,I;return a.isInText=!0,{startState:function(e){var t={tokenize:a,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var n=t.tokenize(e,t);return(n||w)&&'comment'!=n&&(I=null,t.state=t.state(w||n,e,t),I&&(n='error'==I?n+' error':I)),n},indent:function(t,n,o){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+S;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=a)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1===E.multilineTagIndentPastTag?t.tagStart+S*(E.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(E.alignCDATA&&/$/,blockCommentStart:'',configuration:E.htmlMode?'html':'xml',helperType:E.htmlMode?'html':'xml',skipAttribute:function(e){e.state==x&&(e.state=b)}}}),e.defineMIME('text/xml','xml'),e.defineMIME('application/xml','xml'),e.mimeModes.hasOwnProperty('text/html')||e.defineMIME('text/html',{name:'xml',htmlMode:!0})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';function t(e,t,n){return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||'quasi'==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode('javascript',function(n,o){function r(e){for(var t=!1,n=!1,o;null!=(o=e.next());){if(!t){if('/'==o&&!n)return;'['==o?n=!0:n&&']'==o&&(n=!1)}t=!t&&'\\'==o}}function a(e,t,n){return Pe=e,De=n,t}function s(e,n){var o=e.next();if('"'==o||'\''==o)return n.tokenize=i(o),n.tokenize(e,n);if('.'==o&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a('number','number');if('.'==o&&e.match('..'))return a('spread','meta');if(/[\[\]{}\(\),;\:\.]/.test(o))return a(o);if('='==o&&e.eat('>'))return a('=>','operator');if('0'==o&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a('number','number');if('0'==o&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),a('number','number');if('0'==o&&e.eat(/b/i))return e.eatWhile(/[01]/i),a('number','number');if(/\d/.test(o))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a('number','number');if('/'==o)return e.eat('*')?(n.tokenize=d,d(e,n)):e.eat('/')?(e.skipToEnd(),a('comment','comment')):t(e,n,1)?(r(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a('regexp','string-2')):(e.eatWhile(Ie),a('operator','operator',e.current()));if('`'==o)return n.tokenize=l,l(e,n);if('#'==o)return e.skipToEnd(),a('error','error');if(Ie.test(o))return e.eatWhile(Ie),a('operator','operator',e.current());if(Te.test(o)){e.eatWhile(Te);var s=e.current(),p=we.propertyIsEnumerable(s)&&we[s];return p&&'.'!=n.lastType?a(p.type,p.style,s):a('variable','variable',s)}}function i(e){return function(t,n){var o=!1,r;if(Se&&'@'==t.peek()&&t.match(Ne))return n.tokenize=s,a('jsonld-keyword','meta');for(;null!=(r=t.next())&&(r!=e||o);)o=!o&&'\\'==r;return o||(n.tokenize=s),a('string','string')}}function d(e,t){for(var n=!1,o;o=e.next();){if('/'==o&&n){t.tokenize=s;break}n='*'==o}return a('comment','comment')}function l(e,t){for(var n=!1,o;null!=(o=e.next());){if(!n&&('`'==o||'$'==o&&e.eat('{'))){t.tokenize=s;break}n=!n&&'\\'==o}return a('quasi','string-2',e.current())}function p(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf('=>',e.start);if(!(0>n)){for(var o=0,r=!1,a=n-1;0<=a;--a){var i=e.string.charAt(a),s=Ae.indexOf(i);if(0<=s&&3>s){if(!o){++a;break}if(0==--o)break}else if(3<=s&&6>s)++o;else if(Te.test(i))r=!0;else{if(/["'\/]/.test(i))return;if(r&&!o){++a;break}}}r&&!o&&(t.fatArrowAt=a)}}function c(e,t,n,o,r,a){this.indented=e,this.column=t,this.type=n,this.prev=r,this.info=a,null!=o&&(this.align=o)}function u(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var o=e.context;o;o=o.prev)for(var n=o.vars;n;n=n.next)if(n.name==t)return!0}function h(e,t,n,o,r){var a=e.cc;for(Re.state=e,Re.stream=r,Re.marked=null,Re.cc=a,Re.style=t,e.lexical.hasOwnProperty('align')||(e.lexical.align=!0);;){var i=a.length?a.pop():Ee?E:S;if(i(n,o)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Re.marked?Re.marked:'variable'==n&&u(e,o)?'variable-2':t}}}function m(){for(var e=arguments.length-1;0<=e;e--)Re.cc.push(arguments[e])}function g(){return m.apply(null,arguments),!0}function f(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Re.state;if(Re.marked='def',n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;o.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){Re.state.context={prev:Re.state.context,vars:Re.state.localVars},Re.state.localVars=Oe}function b(){Re.state.localVars=Re.state.context.vars,Re.state.context=Re.state.context.prev}function v(e,t){var n=function(){var n=Re.state,o=n.indented;if('stat'==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&')'==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new c(o,Re.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function x(){var e=Re.state;e.lexical.prev&&(')'==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function C(e){function t(n){return n==e?g():';'==e?m():g(t)}return t}function S(e,t){return'var'==e?g(v('vardef',t.length),X,C(';'),x):'keyword a'==e?g(v('form'),E,S,x):'keyword b'==e?g(v('form'),S,x):'{'==e?g(v('}'),j,x):';'==e?g():'if'==e?('else'==Re.state.lexical.info&&Re.state.cc[Re.state.cc.length-1]==x&&Re.state.cc.pop()(),g(v('form'),E,S,x,Z)):'function'==e?g(ae):'for'==e?g(v('form'),ee,S,x):'variable'==e?g(v('stat'),F):'switch'==e?g(v('form'),E,v('}','switch'),C('{'),j,x,x):'case'==e?g(E,C(':')):'default'==e?g(C(':')):'catch'==e?g(v('form'),y,C('('),ie,C(')'),S,x,b):'class'==e?g(v('form'),se,x):'export'==e?g(v('stat'),ce,x):'import'==e?g(v('stat'),ue,x):'module'==e?g(v('form'),Q,v('}'),C('{'),j,x,x):m(v('stat'),E,C(';'),x)}function E(e){return T(e,!1)}function k(e){return T(e,!0)}function T(e,t){if(Re.state.fatArrowAt==Re.stream.start){var n=t?P:O;if('('==e)return g(y,v(')'),H(Q,')'),x,C('=>'),n,b);if('variable'==e)return m(y,Q,C('=>'),n,b)}var o=t?A:N;return Le.hasOwnProperty(e)?g(o):'function'==e?g(ae,o):'keyword c'==e?g(t?I:w):'('==e?g(v(')'),w,be,C(')'),x,o):'operator'==e||'spread'==e?g(t?k:E):'['==e?g(v(']'),fe,x,o):'{'==e?q(U,'}',null,o):'quasi'==e?m(L,o):'new'==e?g(D(t)):g()}function w(e){return e.match(/[;\}\)\],]/)?m():m(E)}function I(e){return e.match(/[;\}\)\],]/)?m():m(k)}function N(e,t){return','==e?g(E):A(e,t,!1)}function A(e,t,n){var o=!1==n?N:A,r=!1==n?E:k;return'=>'==e?g(y,n?P:O,b):'operator'==e?/\+\+|--/.test(t)?g(o):'?'==t?g(E,C(':'),r):g(r):'quasi'==e?m(L,o):';'==e?void 0:'('==e?q(k,')','call',o):'.'==e?g(B,o):'['==e?g(v(']'),w,C(']'),x,o):void 0}function L(e,t){return'quasi'==e?'${'==t.slice(t.length-2)?g(E,R):g(L):m()}function R(e){if('}'==e)return Re.marked='string-2',Re.state.tokenize=l,g(L)}function O(e){return p(Re.stream,Re.state),m('{'==e?S:E)}function P(e){return p(Re.stream,Re.state),m('{'==e?S:k)}function D(e){return function(t){return'.'==t?g(e?M:_):m(e?k:E)}}function _(e,t){if('target'==t)return Re.marked='keyword',g(N)}function M(e,t){if('target'==t)return Re.marked='keyword',g(A)}function F(e){return':'==e?g(x,S):m(N,C(';'),x)}function B(e){if('variable'==e)return Re.marked='property',g()}function U(e,t){return'variable'==e||'keyword'==Re.style?(Re.marked='property','get'==t||'set'==t?g(V):g(W)):'number'==e||'string'==e?(Re.marked=Se?'property':Re.style+' property',g(W)):'jsonld-keyword'==e?g(W):'modifier'==e?g(U):'['==e?g(E,C(']'),W):'spread'==e?g(E):void 0}function V(e){return'variable'==e?(Re.marked='property',g(ae)):m(W)}function W(e){return':'==e?g(k):'('==e?m(ae):void 0}function H(e,t){function n(o){if(','==o){var r=Re.state.lexical;return'call'==r.info&&(r.pos=(r.pos||0)+1),g(e,n)}return o==t?g():g(C(t))}return function(o){return o==t?g():m(e,n)}}function q(e,t,n){for(var o=3;o!?|~^]/,Ne=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ae='([{}])',Le={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Re={state:null,column:null,marked:null,cc:null},Oe={name:'this',next:{name:'arguments'}},Pe,De;return x.lex=!0,{startState:function(e){var t={tokenize:s,lastType:'sof',cc:[],lexical:new c((e||0)-xe,0,'block',!1),localVars:o.localVars,context:o.localVars&&{vars:o.localVars},indented:e||0};return o.globalVars&&'object'==typeof o.globalVars&&(t.globalVars=o.globalVars),t},token:function(e,t){if(e.sol()&&(!t.lexical.hasOwnProperty('align')&&(t.lexical.align=!1),t.indented=e.indentation(),p(e,t)),t.tokenize!=d&&e.eatSpace())return null;var n=t.tokenize(e,t);return'comment'==Pe?n:(t.lastType='operator'==Pe&&('++'==De||'--'==De)?'incdec':Pe,h(t,n,Pe,De,e))},indent:function(t,n){if(t.tokenize==d)return e.Pass;if(t.tokenize!=s)return 0;var r=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var l=t.cc.length-1,i;0<=l;--l)if(i=t.cc[l],i==x)a=a.prev;else if(i!=Z)break;'stat'==a.type&&'}'==r&&(a=a.prev),Ce&&')'==a.type&&'stat'==a.prev.type&&(a=a.prev);var p=a.type,c=r==p;return'vardef'==p?a.indented+('operator'==t.lastType||','==t.lastType?a.info+1:0):'form'==p&&'{'==r?a.indented:'form'==p?a.indented+xe:'stat'==p?a.indented+(ve(t,n)?Ce||xe:0):'switch'!=a.info||c||!1==o.doubleIndentSwitch?a.align?a.column+(c?0:1):a.indented+(c?0:xe):a.indented+(/^(?:case|default)\b/.test(n)?xe:2*xe)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ee?null:'/*',blockCommentEnd:Ee?null:'*/',lineComment:Ee?null:'//',fold:'brace',closeBrackets:'()[]{}\'\'""``',helperType:Ee?'json':'javascript',jsonldMode:Se,jsonMode:Ee,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==E||t==k)&&e.cc.pop()}}}),e.registerHelper('wordChars','javascript',/[\w$]/),e.defineMIME('text/javascript','javascript'),e.defineMIME('text/ecmascript','javascript'),e.defineMIME('application/javascript','javascript'),e.defineMIME('application/x-javascript','javascript'),e.defineMIME('application/ecmascript','javascript'),e.defineMIME('application/json',{name:'javascript',json:!0}),e.defineMIME('application/x-json',{name:'javascript',json:!0}),e.defineMIME('application/ld+json',{name:'javascript',jsonld:!0}),e.defineMIME('text/typescript',{name:'javascript',typescript:!0}),e.defineMIME('application/typescript',{name:'javascript',typescript:!0})}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../../lib/codemirror')):'function'==typeof define&&define.amd?define(['../../lib/codemirror'],e):e(CodeMirror)}(function(e){'use strict';function t(e){for(var t={},n=0;n*\/]/.test(n)?o(null,'select-op'):'.'==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o('qualifier','qualifier'):/[:;{}\[\]\(\)]/.test(n)?o(null,n):'u'==n&&e.match(/rl(-prefix)?\(/)||'d'==n&&e.match('omain(')||'r'==n&&e.match('egexp(')?(e.backUp(1),t.tokenize=i,o('property','word')):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),o('property','word')):o(null,null)}function a(e){return function(t,n){for(var r=!1,a;null!=(a=t.next());){if(a==e&&!r){')'==e&&t.backUp(1);break}r=!r&&'\\'==a}return a!=e&&(r||')'==e)||(n.tokenize=null),o('string','string')}}function i(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:a(')'),o(null,'(')}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function d(e,t,n,o){return e.context=new s(n,t.indentation()+(!1===o?0:m),e.context),n}function l(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function p(e,t,n){return N[n.context.type](e,t,n)}function c(e,t,o,r){for(var n=r||1;0','i')}function a(e,t){for(var n in e)for(var o=t[n]||(t[n]=[]),r=e[n],a=r.length-1;0<=a;a--)o.unshift(r[a])}function i(e,t){for(var n=0,r;n\s\/]/.test(o.current())&&(u=a.htmlState.tagName&&a.htmlState.tagName.toLowerCase())&&p.hasOwnProperty(u))a.inTag=u+' ';else if(a.inTag&&c&&/>$/.test(o.current())){var h=/^([\S]+) (.*)/.exec(a.inTag);a.inTag=null;var m='>'==o.current()&&i(p[h[1]],h[2]),g=e.getMode(n,m),f=r(h[1],!0),y=r(h[1],!1);a.token=function(e,n){return e.match(f,!1)?(n.token=d,n.localState=n.localMode=null,null):t(e,y,n.localMode.token(e,n.localState))},a.localMode=g,a.localState=e.startState(g,l.indent(a.htmlState,''))}else a.inTag&&(a.inTag+=o.current(),o.eol()&&(a.inTag+=' '));return s}var l=e.getMode(n,{name:'xml',htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),p={},c=o&&o.tags,u=o&&o.scriptTypes;if(a(s,p),c&&a(c,p),u)for(var h=u.length-1;0<=h;h--)p.script.unshift(['type',u[h].matches,u[h].mode]);return{startState:function(){var e=l.startState();return{token:d,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},'xml','javascript','css'),e.defineMIME('text/html','htmlmixed')}),function(e){'object'==typeof exports&&'object'==typeof module?e(require('../lib/codemirror'),require('../addon/search/searchcursor'),require('../addon/edit/matchbrackets')):'function'==typeof define&&define.amd?define(['../lib/codemirror','../addon/search/searchcursor','../addon/edit/matchbrackets'],e):e(CodeMirror)}(function(e){'use strict';function t(t,n,o){if(0>o&&0==n.ch)return t.clipPos(u(n.line-1));var r=t.getLine(n.line);if(0=r.length)return t.clipPos(u(n.line+1,0));for(var a='start',s=n.ch,d=0>o?0:r.length,l=0,i;s!=d;s+=o,l++){var p=r.charAt(0>o?s-1:s),c='_'!=p&&e.isWordChar(p)?'w':'o';if('w'==c&&p.toUpperCase()==p&&(c='W'),'start'==a)'o'!=c&&(a='in',i=c);else if('in'==a&&i!=c){if('w'==i&&'W'==c&&0>o&&s--,'W'==i&&'w'==c&&0n?o.from():o.to()})}function o(t,n){return t.isReadOnly()?e.Pass:void t.operation(function(){for(var e=t.listSelections().length,o=[],r=-1,a=0,i;a=n&&e.execCommand('goLineUp')}e.scrollTo(null,t.top-e.defaultTextHeight())},c[p[g+'Down']='scrollLineDown']=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,'local')+1;e.getCursor().line<=n&&e.execCommand('goLineDown')}e.scrollTo(null,t.top+e.defaultTextHeight())},c[p['Shift-'+m+'L']='splitSelectionByLine']=function(e){for(var t=e.listSelections(),n=[],o=0;or.line&&i==a.line&&0==a.ch||n.push({anchor:i==r.line?r:u(i,0),head:i==a.line?a:u(i)});e.setSelections(n,0)},p['Shift-Tab']='indentLess',c[p.Esc='singleSelectionTop']=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},c[p[m+'L']='selectLine']=function(e){for(var t=e.listSelections(),n=[],o=0,r;or?o.push(d,l):o.length&&(o[o.length-1]=l),r=l}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange('\n'+i,u(t.lastLine()),null,'+swapLine'):t.replaceRange(i+'\n',u(r,0),null,'+swapLine')}t.setSelections(a),t.scrollIntoView()})},c[p[y+'Down']='swapLineDown']=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),o=[],r=t.lastLine()+1,a=n.length-1;0<=a;a--){var i=n[a],s=i.to().line+1,d=i.from().line;0!=i.to().ch||i.empty()||s--,se.firstLine()&&e.addSelection(u(o.head.line-1,o.head.ch))})},c[p['Shift-Alt-Down']='selectLinesDownward']=function(e){e.operation(function(){for(var t=e.listSelections(),n=0,o;n',type:'keyToKey',toKeys:'h'},{keys:'',type:'keyToKey',toKeys:'l'},{keys:'',type:'keyToKey',toKeys:'k'},{keys:'',type:'keyToKey',toKeys:'j'},{keys:'',type:'keyToKey',toKeys:'l'},{keys:'',type:'keyToKey',toKeys:'h',context:'normal'},{keys:'',type:'keyToKey',toKeys:'W'},{keys:'',type:'keyToKey',toKeys:'B',context:'normal'},{keys:'',type:'keyToKey',toKeys:'w'},{keys:'',type:'keyToKey',toKeys:'b',context:'normal'},{keys:'',type:'keyToKey',toKeys:'j'},{keys:'',type:'keyToKey',toKeys:'k'},{keys:'',type:'keyToKey',toKeys:''},{keys:'',type:'keyToKey',toKeys:''},{keys:'',type:'keyToKey',toKeys:'',context:'insert'},{keys:'',type:'keyToKey',toKeys:'',context:'insert'},{keys:'s',type:'keyToKey',toKeys:'cl',context:'normal'},{keys:'s',type:'keyToKey',toKeys:'c',context:'visual'},{keys:'S',type:'keyToKey',toKeys:'cc',context:'normal'},{keys:'S',type:'keyToKey',toKeys:'VdO',context:'visual'},{keys:'',type:'keyToKey',toKeys:'0'},{keys:'',type:'keyToKey',toKeys:'$'},{keys:'',type:'keyToKey',toKeys:''},{keys:'',type:'keyToKey',toKeys:''},{keys:'',type:'keyToKey',toKeys:'j^',context:'normal'},{keys:'',type:'action',action:'toggleOverwrite',context:'insert'},{keys:'H',type:'motion',motion:'moveToTopLine',motionArgs:{linewise:!0,toJumplist:!0}},{keys:'M',type:'motion',motion:'moveToMiddleLine',motionArgs:{linewise:!0,toJumplist:!0}},{keys:'L',type:'motion',motion:'moveToBottomLine',motionArgs:{linewise:!0,toJumplist:!0}},{keys:'h',type:'motion',motion:'moveByCharacters',motionArgs:{forward:!1}},{keys:'l',type:'motion',motion:'moveByCharacters',motionArgs:{forward:!0}},{keys:'j',type:'motion',motion:'moveByLines',motionArgs:{forward:!0,linewise:!0}},{keys:'k',type:'motion',motion:'moveByLines',motionArgs:{forward:!1,linewise:!0}},{keys:'gj',type:'motion',motion:'moveByDisplayLines',motionArgs:{forward:!0}},{keys:'gk',type:'motion',motion:'moveByDisplayLines',motionArgs:{forward:!1}},{keys:'w',type:'motion',motion:'moveByWords',motionArgs:{forward:!0,wordEnd:!1}},{keys:'W',type:'motion',motion:'moveByWords',motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:'e',type:'motion',motion:'moveByWords',motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:'E',type:'motion',motion:'moveByWords',motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:'b',type:'motion',motion:'moveByWords',motionArgs:{forward:!1,wordEnd:!1}},{keys:'B',type:'motion',motion:'moveByWords',motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:'ge',type:'motion',motion:'moveByWords',motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:'gE',type:'motion',motion:'moveByWords',motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:'{',type:'motion',motion:'moveByParagraph',motionArgs:{forward:!1,toJumplist:!0}},{keys:'}',type:'motion',motion:'moveByParagraph',motionArgs:{forward:!0,toJumplist:!0}},{keys:'',type:'motion',motion:'moveByPage',motionArgs:{forward:!0}},{keys:'',type:'motion',motion:'moveByPage',motionArgs:{forward:!1}},{keys:'',type:'motion',motion:'moveByScroll',motionArgs:{forward:!0,explicitRepeat:!0}},{keys:'',type:'motion',motion:'moveByScroll',motionArgs:{forward:!1,explicitRepeat:!0}},{keys:'gg',type:'motion',motion:'moveToLineOrEdgeOfDocument',motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:'G',type:'motion',motion:'moveToLineOrEdgeOfDocument',motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:'0',type:'motion',motion:'moveToStartOfLine'},{keys:'^',type:'motion',motion:'moveToFirstNonWhiteSpaceCharacter'},{keys:'+',type:'motion',motion:'moveByLines',motionArgs:{forward:!0,toFirstChar:!0}},{keys:'-',type:'motion',motion:'moveByLines',motionArgs:{forward:!1,toFirstChar:!0}},{keys:'_',type:'motion',motion:'moveByLines',motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:'$',type:'motion',motion:'moveToEol',motionArgs:{inclusive:!0}},{keys:'%',type:'motion',motion:'moveToMatchedSymbol',motionArgs:{inclusive:!0,toJumplist:!0}},{keys:'f',type:'motion',motion:'moveToCharacter',motionArgs:{forward:!0,inclusive:!0}},{keys:'F',type:'motion',motion:'moveToCharacter',motionArgs:{forward:!1}},{keys:'t',type:'motion',motion:'moveTillCharacter',motionArgs:{forward:!0,inclusive:!0}},{keys:'T',type:'motion',motion:'moveTillCharacter',motionArgs:{forward:!1}},{keys:';',type:'motion',motion:'repeatLastCharacterSearch',motionArgs:{forward:!0}},{keys:',',type:'motion',motion:'repeatLastCharacterSearch',motionArgs:{forward:!1}},{keys:'\'',type:'motion',motion:'goToMark',motionArgs:{toJumplist:!0,linewise:!0}},{keys:'`',type:'motion',motion:'goToMark',motionArgs:{toJumplist:!0}},{keys:']`',type:'motion',motion:'jumpToMark',motionArgs:{forward:!0}},{keys:'[`',type:'motion',motion:'jumpToMark',motionArgs:{forward:!1}},{keys:']\'',type:'motion',motion:'jumpToMark',motionArgs:{forward:!0,linewise:!0}},{keys:'[\'',type:'motion',motion:'jumpToMark',motionArgs:{forward:!1,linewise:!0}},{keys:']p',type:'action',action:'paste',isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:'[p',type:'action',action:'paste',isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:']',type:'motion',motion:'moveToSymbol',motionArgs:{forward:!0,toJumplist:!0}},{keys:'[',type:'motion',motion:'moveToSymbol',motionArgs:{forward:!1,toJumplist:!0}},{keys:'|',type:'motion',motion:'moveToColumn'},{keys:'o',type:'motion',motion:'moveToOtherHighlightedEnd',context:'visual'},{keys:'O',type:'motion',motion:'moveToOtherHighlightedEnd',motionArgs:{sameLine:!0},context:'visual'},{keys:'d',type:'operator',operator:'delete'},{keys:'y',type:'operator',operator:'yank'},{keys:'c',type:'operator',operator:'change'},{keys:'>',type:'operator',operator:'indent',operatorArgs:{indentRight:!0}},{keys:'<',type:'operator',operator:'indent',operatorArgs:{indentRight:!1}},{keys:'g~',type:'operator',operator:'changeCase'},{keys:'gu',type:'operator',operator:'changeCase',operatorArgs:{toLower:!0},isEdit:!0},{keys:'gU',type:'operator',operator:'changeCase',operatorArgs:{toLower:!1},isEdit:!0},{keys:'n',type:'motion',motion:'findNext',motionArgs:{forward:!0,toJumplist:!0}},{keys:'N',type:'motion',motion:'findNext',motionArgs:{forward:!1,toJumplist:!0}},{keys:'x',type:'operatorMotion',operator:'delete',motion:'moveByCharacters',motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:'X',type:'operatorMotion',operator:'delete',motion:'moveByCharacters',motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:'D',type:'operatorMotion',operator:'delete',motion:'moveToEol',motionArgs:{inclusive:!0},context:'normal'},{keys:'D',type:'operator',operator:'delete',operatorArgs:{linewise:!0},context:'visual'},{keys:'Y',type:'operatorMotion',operator:'yank',motion:'expandToLine',motionArgs:{linewise:!0},context:'normal'},{keys:'Y',type:'operator',operator:'yank',operatorArgs:{linewise:!0},context:'visual'},{keys:'C',type:'operatorMotion',operator:'change',motion:'moveToEol',motionArgs:{inclusive:!0},context:'normal'},{keys:'C',type:'operator',operator:'change',operatorArgs:{linewise:!0},context:'visual'},{keys:'~',type:'operatorMotion',operator:'changeCase',motion:'moveByCharacters',motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:'normal'},{keys:'~',type:'operator',operator:'changeCase',context:'visual'},{keys:'',type:'operatorMotion',operator:'delete',motion:'moveByWords',motionArgs:{forward:!1,wordEnd:!1},context:'insert'},{keys:'',type:'action',action:'jumpListWalk',actionArgs:{forward:!0}},{keys:'',type:'action',action:'jumpListWalk',actionArgs:{forward:!1}},{keys:'',type:'action',action:'scroll',actionArgs:{forward:!0,linewise:!0}},{keys:'',type:'action',action:'scroll',actionArgs:{forward:!1,linewise:!0}},{keys:'a',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{insertAt:'charAfter'},context:'normal'},{keys:'A',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{insertAt:'eol'},context:'normal'},{keys:'A',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{insertAt:'endOfSelectedArea'},context:'visual'},{keys:'i',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{insertAt:'inplace'},context:'normal'},{keys:'I',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{insertAt:'firstNonBlank'},context:'normal'},{keys:'I',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{insertAt:'startOfSelectedArea'},context:'visual'},{keys:'o',type:'action',action:'newLineAndEnterInsertMode',isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:'normal'},{keys:'O',type:'action',action:'newLineAndEnterInsertMode',isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:'normal'},{keys:'v',type:'action',action:'toggleVisualMode'},{keys:'V',type:'action',action:'toggleVisualMode',actionArgs:{linewise:!0}},{keys:'',type:'action',action:'toggleVisualMode',actionArgs:{blockwise:!0}},{keys:'',type:'action',action:'toggleVisualMode',actionArgs:{blockwise:!0}},{keys:'gv',type:'action',action:'reselectLastSelection'},{keys:'J',type:'action',action:'joinLines',isEdit:!0},{keys:'p',type:'action',action:'paste',isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:'P',type:'action',action:'paste',isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:'r',type:'action',action:'replace',isEdit:!0},{keys:'@',type:'action',action:'replayMacro'},{keys:'q',type:'action',action:'enterMacroRecordMode'},{keys:'R',type:'action',action:'enterInsertMode',isEdit:!0,actionArgs:{replace:!0}},{keys:'u',type:'action',action:'undo',context:'normal'},{keys:'u',type:'operator',operator:'changeCase',operatorArgs:{toLower:!0},context:'visual',isEdit:!0},{keys:'U',type:'operator',operator:'changeCase',operatorArgs:{toLower:!1},context:'visual',isEdit:!0},{keys:'',type:'action',action:'redo'},{keys:'m',type:'action',action:'setMark'},{keys:'"',type:'action',action:'setRegister'},{keys:'zz',type:'action',action:'scrollToCursor',actionArgs:{position:'center'}},{keys:'z.',type:'action',action:'scrollToCursor',actionArgs:{position:'center'},motion:'moveToFirstNonWhiteSpaceCharacter'},{keys:'zt',type:'action',action:'scrollToCursor',actionArgs:{position:'top'}},{keys:'z',type:'action',action:'scrollToCursor',actionArgs:{position:'top'},motion:'moveToFirstNonWhiteSpaceCharacter'},{keys:'z-',type:'action',action:'scrollToCursor',actionArgs:{position:'bottom'}},{keys:'zb',type:'action',action:'scrollToCursor',actionArgs:{position:'bottom'},motion:'moveToFirstNonWhiteSpaceCharacter'},{keys:'.',type:'action',action:'repeatLastEdit'},{keys:'',type:'action',action:'incrementNumberToken',isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:'',type:'action',action:'incrementNumberToken',isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:'',type:'action',action:'indent',actionArgs:{indentRight:!0},context:'insert'},{keys:'',type:'action',action:'indent',actionArgs:{indentRight:!1},context:'insert'},{keys:'a',type:'motion',motion:'textObjectManipulation'},{keys:'i',type:'motion',motion:'textObjectManipulation',motionArgs:{textObjectInner:!0}},{keys:'/',type:'search',searchArgs:{forward:!0,querySrc:'prompt',toJumplist:!0}},{keys:'?',type:'search',searchArgs:{forward:!1,querySrc:'prompt',toJumplist:!0}},{keys:'*',type:'search',searchArgs:{forward:!0,querySrc:'wordUnderCursor',wholeWordOnly:!0,toJumplist:!0}},{keys:'#',type:'search',searchArgs:{forward:!1,querySrc:'wordUnderCursor',wholeWordOnly:!0,toJumplist:!0}},{keys:'g*',type:'search',searchArgs:{forward:!0,querySrc:'wordUnderCursor',toJumplist:!0}},{keys:'g#',type:'search',searchArgs:{forward:!1,querySrc:'wordUnderCursor',toJumplist:!0}},{keys:':',type:'ex'}],d=[{name:'colorscheme',shortName:'colo'},{name:'map'},{name:'imap',shortName:'im'},{name:'nmap',shortName:'nm'},{name:'vmap',shortName:'vm'},{name:'unmap'},{name:'write',shortName:'w'},{name:'undo',shortName:'u'},{name:'redo',shortName:'red'},{name:'set',shortName:'se'},{name:'set',shortName:'se'},{name:'setlocal',shortName:'setl'},{name:'setglobal',shortName:'setg'},{name:'sort',shortName:'sor'},{name:'substitute',shortName:'s',possiblyAsync:!0},{name:'nohlsearch',shortName:'noh'},{name:'yank',shortName:'y'},{name:'delmarks',shortName:'delm'},{name:'registers',shortName:'reg',excludeFromCommandHistory:!0},{name:'global',shortName:'g'}],l=t.Pos;t.Vim=function(){function i(e){e.setOption('disableInput',!0),e.setOption('showCursorWhenSelecting',!1),t.signal(e,'vim-mode-change',{mode:'normal'}),e.on('cursorActivity',tt),N(e),t.on(e.getInputField(),'paste',g(e))}function p(e){e.setOption('disableInput',!1),e.off('cursorActivity',tt),t.off(e.getInputField(),'paste',g(e)),e.state.vim=null}function c(e,n){this==t.keyMap.vim&&t.rmClass(e.getWrapperElement(),'cm-fat-cursor'),n&&n.attach==u||p(e,!1)}function u(e,n){this==t.keyMap.vim&&t.addClass(e.getWrapperElement(),'cm-fat-cursor'),n&&n.attach==u||i(e)}function h(e,n){if(n){if(this[e])return this[e];var o=m(e);if(!o)return!1;var r=t.Vim.findKey(n,o);return'function'==typeof r&&t.signal(n,'vim-keypress',o),r}}function m(e){if('\''==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&'Shift'==t[0]&&1==n.length)return!1;for(var o=!1,r=0,a;r')}function g(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(B(e.getCursor(),0,1)),wt.enterInsertMode(e,{},t))}),t.onPasteFn}function f(t,n){for(var o=[],r=t;r=e.firstLine()&&t<=e.lastLine()}function b(e){return /^[a-z]$/.test(e)}function v(e){return-1!='()[]{}'.indexOf(e)}function x(e){return pt.test(e)}function C(e){return /^[A-Z]$/.test(e)}function S(e){return /^\s*$/.test(e)}function E(e,t){for(var n=0;n'==t.slice(-11)){var n=t.length-11,o=e.slice(0,n),r=t.slice(0,n);return o==r&&e.length>n?'full':0==r.indexOf(o)&&'partial'}return e==t?'full':0==t.indexOf(e)&&'partial'}function H(e){var t=/^.*(<[\w\-]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(1':n='\n';break;case'':n=' ';break;default:}return n}function q(e,t,n){return function(){for(var o=0;op?u:0,m=r[h].anchor,g=a(m.line,i.line),f=o(m.line,i.line),y=m.ch,b=i.ch,v=r[h].head.ch-y,x=b-y;0=x?(y++,!s&&b--):0>v&&0<=x?(y--,!c&&b++):0>v&&-1==x&&(y--,b++);for(var C=g,S;C<=f;C++)S={anchor:new l(C,y),head:new l(C,b)},n.push(S);return p=i.line==f?n.length-1:0,e.setSelections(n),t.ch=b,m.ch=y,m}function te(e,t,n){for(var o=[],r=0,a;ru&&(s.line=u),s.ch=Y(e,s.line)}else s.ch=0,d.ch=Y(e,d.line);return{ranges:[{anchor:d,head:s}],primary:0}}if('block'==n){for(var h=a(d.line,s.line),m=a(d.ch,s.ch),g=o(d.line,s.line),f=o(d.ch,s.ch)+1,y=g-h+1,b=s.line==h?0:y-1,v=[],x=0;x=i.length)return null;o?d=ut[0]:(d=ct[0],!d(i.charAt(s))&&(d=ct[1]));for(var p=s,c=s;d(i.charAt(p))&&pc&&!f?f=!0:r=!1,u=d;u>p&&(r&&a(u)!=f&&u!=d||!s(u,-1,!0));u--);return i=new l(u,0),{start:i,end:h}}function ke(e,t,n,o){var r=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],i={"(":'(',")":'(',"[":'[',"]":'[',"{":'{',"}":'{'}[n],s=e.getLine(r.line).charAt(r.ch),d=s===i?1:0,p,c;if(p=e.scanForBracket(l(r.line,r.ch+d),-1,null,{bracketRegex:a}),c=e.scanForBracket(l(r.line,r.ch+d),1,null,{bracketRegex:a}),!p||!c)return{start:r,end:r};if(p=p.pos,c=c.pos,p.line==c.line&&p.ch>c.ch||p.line>c.line){var u=p;p=c,c=u}return o?c.ch+=1:p.ch+=1,{start:p,end:c}}function Te(e,t,n,o){var r=j(t),a=e.getLine(r.line),s=a.split(''),d=s.indexOf(n),p,c,u,i;if(r.ch'+t+'',{bottom:!0,duration:5e3}):alert(t)}function Me(e,t){var n=''+(e||'')+'';return t&&(n+=' '+t+''),n}function Fe(e,t){var n=(t.prefix||'')+' '+(t.desc||''),o=Me(t.prefix,t.desc);Ne(e,o,n,t.onClose,t)}function Be(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=['global','multiline','ignoreCase','source'],o=0,r;o=t&&e<=n:e==t}function ze(e){var t=e.getScrollInfo(),n=e.coordsChar({left:0,top:6+t.top},'local'),o=t.clientHeight-10+t.top,r=e.coordsChar({left:0,top:o},'local');return{top:n.line,bottom:r.line}}function Ke(e,t,n){if('\''==n){var o=e.doc.history.done,r=o[o.length-2];return r&&r.ranges&&r.ranges[0].head}var a=t.marks[n];return a&&a.find()}function Ge(e,n,o,r,a,i,s,d,l){function p(){e.operation(function(){for(;!m;)c(),u();h()})}function c(){var t=e.getRange(i.from(),i.to()),n=t.replace(s,d);i.replace(n)}function u(){for(;i.findNext()&&je(i.from(),r,a);)if(o||!g||i.from().line!=g.line)return e.scrollIntoView(i.from(),30),e.setSelection(i.from(),i.to()),g=i.from(),void(m=!1);m=!0}function h(t){if(t&&t(),e.focus(),g){e.setCursor(g);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=g.ch}l&&l()}e.state.vim.exMode=!0;var m=!1,g=i.from();return u(),m?void _e(e,'No matches for '+s.source):n?void Fe(e,{prefix:'replace with '+d+' (y/n/a/q/l)',onKeyDown:function(n,o,r){t.e_stop(n);var a=t.keyName(n);switch(a){case'Y':c(),u();break;case'N':u();break;case'A':var i=l;l=void 0,e.operation(p),l=i;break;case'L':c();case'Q':case'Esc':case'Ctrl-C':case'Ctrl-[':h(r);}return m&&h(r),!0}}):(p(),void(l&&l()))}function Xe(e){var n=e.state.vim,o=Ct.macroModeState,r=Ct.registerController.getRegister('.'),a=o.isPlaying,s=o.lastInsertModeChanges,d=[];if(!a){for(var l=s.inVisualBlock?n.lastSelection.visualBlock.height:1,p=s.changes,d=[],c=0;c|<\w+>|./.exec(i),c=p[0],i=i.substring(p.index+c.length),t.Vim.handleKey(e,c,'macro'),n.insertMode){var u=a.insertModeChanges[d++].changes;Ct.macroModeState.lastInsertModeChanges.changes=u,st(e,u,1),Xe(e)}o.isPlaying=!1}function Je(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Ct.registerController.getRegister(n);o&&o.pushText(t)}}function $e(e){if(!e.isPlaying){var t=e.latestRegister,n=Ct.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function Ze(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Ct.registerController.getRegister(n);o&&o.pushSearchQuery&&o.pushSearchQuery(t)}}function et(e,t){var n=Ct.macroModeState,o=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(o.expectCursorActivityForChange=!0,'+input'==t.origin||'paste'==t.origin||void 0===t.origin){var r=t.text.join('\n');o.maybeReset&&(o.changes=[],o.maybeReset=!1),o.changes.push(r)}t=t.next}}function tt(e){var t=e.state.vim;if(t.insertMode){var n=Ct.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else e.curOp.isVimOp||ot(e,t);t.visualMode&&nt(e)}function nt(e){var t=e.state.vim,n=M(e,j(t.sel.head)),o=B(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,o,{className:'cm-animate-fat-cursor'})}function ot(e,n){var o=e.getCursor('anchor'),r=e.getCursor('head');if(n.visualMode&&!e.somethingSelected()?le(e,!1):!n.visualMode&&!n.insertMode&&e.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,t.signal(e,'vim-mode-change',{mode:'visual'})),n.visualMode){var a=K(r,o)?0:-1,i=K(r,o)?-1:0;r=B(r,0,a),o=B(o,0,i),n.sel={anchor:o,head:r},Ce(e,n,'<',G(r,o)),Ce(e,n,'>',X(r,o))}else n.insertMode||(n.lastHPos=e.getCursor().ch)}function rt(e){this.keyName=e}function at(n){var e=Ct.macroModeState,o=e.lastInsertModeChanges,r=t.keyName(n);r&&(-1==r.indexOf('Delete')&&-1==r.indexOf('Backspace')||t.lookupKey(r,'vim-insert',function(){return o.maybeReset&&(o.changes=[],o.maybeReset=!1),o.changes.push(new rt(r)),!0}))}function it(e,t,n,o){function r(){d?Et.processAction(e,t,t.lastEditActionCommand):Et.evalInput(e,t)}function a(n){if(0']),yt=[].concat(ht,mt,gt,['-','"','.',':','/']),bt={};k('filetype',void 0,'string',['ft'],function(e,t){if(void 0!==t){if(void 0===e){var n=t.getOption('mode');return'null'==n?'':n}var n=''==e?'null':e;t.setOption('mode',n)}});var vt=function(){var e=100,t=-1,n=0,o=0,r=Array(e);return{cachedCursor:void 0,add:function(a,i,s){function d(n){var o=++t%e,i=r[o];i&&i.clear(),r[o]=a.setBookmark(n)}var l=t%e,p=r[l];if(p){var c=p.find();c&&!z(c,i)&&d(i)}else d(i);d(s),n=t,o=t-e+1,0>o&&(o=0)},move:function(a,i){t+=i,t>n?t=n:to)}return s}}},xt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};I.prototype={exitMacroRecordMode:function(){var e=Ct.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Ct.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog('(recording)['+t+']',null,{bottom:!0})),this.isRecording=!0)}};var Ct,St;L.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},L.prototype.getRepeat=function(){var e=0;return(0=n.length?(this.iterator=n.length,this.initialPrefix):0>r?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);-1'==i.keys.slice(-11)&&(n.selectedCharacter=H(e)),{type:'full',command:i}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case'motion':this.processMotion(e,t,n);break;case'operator':this.processOperator(e,t,n);break;case'operatorMotion':this.processOperatorMotion(e,t,n);break;case'action':this.processAction(e,t,n);break;case'search':this.processSearch(e,t,n);break;case'ex':case'keyToEx':this.processEx(e,t,n);break;default:}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=F(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var o=t.inputState;if(o.operator){if(o.operator==n.operator)return o.motion='expandToLine',o.motionArgs={linewise:!0},void this.evalInput(e,t);R(e)}o.operator=n.operator,o.operatorArgs=F(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var o=t.visualMode,r=F(n.operatorMotionArgs);r&&o&&r.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),o||this.processMotion(e,t,n)},processAction:function(e,t,n){var o=t.inputState,r=o.getRepeat(),a=F(n.actionArgs)||{};o.selectedCharacter&&(a.selectedCharacter=o.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),a.repeat=r||1,a.repeatIsExplicit=!!r,a.registerName=o.registerName,R(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,o,n),wt[n.action](e,a,t)},processSearch:function(n,e,o){function r(t,r,a){Ct.searchHistoryController.pushInput(t),Ct.searchHistoryController.reset();try{Ue(n,t,r,a)}catch(o){return _e(n,'Invalid regex: '+t),void R(n)}Et.processMotion(n,e,{type:'motion',motion:'findNext',motionArgs:{forward:!0,toJumplist:o.searchArgs.toJumplist}})}function i(e){n.scrollTo(h.left,h.top),r(e,!0,!0);var t=Ct.macroModeState;t.isRecording&&Ze(t,e)}function s(o,e,r){var i=t.keyName(o),s,d;'Up'==i||'Down'==i?(s='Up'==i,d=o.target?o.target.selectionEnd:0,e=Ct.searchHistoryController.nextMatch(e,s)||'',r(e),d&&o.target&&(o.target.selectionEnd=o.target.selectionStart=a(d,o.target.value.length))):'Left'!=i&&'Right'!=i&&'Ctrl'!=i&&'Alt'!=i&&'Shift'!=i&&Ct.searchHistoryController.reset();var p;try{p=Ue(n,e,!0,!0)}catch(t){}p?n.scrollIntoView(He(n,!l,p),30):(qe(n),n.scrollTo(h.left,h.top))}function d(o,e,r){var a=t.keyName(o);'Esc'==a||'Ctrl-C'==a||'Ctrl-['==a||'Backspace'==a&&''==e?(Ct.searchHistoryController.pushInput(e),Ct.searchHistoryController.reset(),Ue(n,u),qe(n),n.scrollTo(h.left,h.top),t.e_stop(o),R(n),r(),n.focus()):'Up'==a||'Down'==a?t.e_stop(o):'Ctrl-U'==a&&(t.e_stop(o),r(''))}if(n.getSearchCursor){var l=o.searchArgs.forward,p=o.searchArgs.wholeWordOnly;Ie(n).setReversed(!l);var c=l?'/':'?',u=Ie(n).getQuery(),h=n.getScrollInfo();switch(o.searchArgs.querySrc){case'prompt':var m=Ct.macroModeState;if(m.isPlaying){var g=m.replaySearchQueries.shift();r(g,!0,!1)}else Fe(n,{onClose:i,prefix:c,desc:Rt,onKeyUp:s,onKeyDown:d});break;case'wordUnderCursor':var f=he(n,!1,!0,!1,!0),y=!0;if(f||(f=he(n,!1,!0,!1,!1),y=!1),!f)return;var g=n.getLine(f.start.line).substring(f.start.ch,f.end.ch);g=y&&p?'\\b'+g+'\\b':$(g),Ct.jumpList.cachedCursor=n.getCursor(),n.setCursor(f.start),r(g,!0,!1);}}},processEx:function(n,e,o){function r(e){Ct.exCommandHistoryController.pushInput(e),Ct.exCommandHistoryController.reset(),Dt.processCommand(n,e)}function i(o,e,r){var i=t.keyName(o),s,d;('Esc'==i||'Ctrl-C'==i||'Ctrl-['==i||'Backspace'==i&&''==e)&&(Ct.exCommandHistoryController.pushInput(e),Ct.exCommandHistoryController.reset(),t.e_stop(o),R(n),r(),n.focus()),'Up'==i||'Down'==i?(t.e_stop(o),s='Up'==i,d=o.target?o.target.selectionEnd:0,e=Ct.exCommandHistoryController.nextMatch(e,s)||'',r(e),d&&o.target&&(o.target.selectionEnd=o.target.selectionStart=a(d,o.target.value.length))):'Ctrl-U'==i?(t.e_stop(o),r('')):'Left'!=i&&'Right'!=i&&'Ctrl'!=i&&'Alt'!=i&&'Shift'!=i&&Ct.exCommandHistoryController.reset()}'keyToEx'==o.type?Dt.processCommand(n,o.exArgs.input):e.visualMode?Fe(n,{onClose:r,prefix:':',value:'\'<,\'>',onKeyDown:i}):Fe(n,{onClose:r,prefix:':',onKeyDown:i})},evalInput:function(e,t){var o=t.inputState,r=o.motion,a=o.motionArgs||{},s=o.operator,d=o.operatorArgs||{},p=o.registerName,c=t.sel,u=j(t.visualMode?M(e,c.head):e.getCursor('head')),h=j(t.visualMode?M(e,c.anchor):e.getCursor('anchor')),m=j(u),g=j(h),f,y,b;if(s&&this.recordLastEdit(t,o),b=void 0===o.repeatOverride?o.getRepeat():o.repeatOverride,0',K(y,f)?f:y)):!s&&(f=M(e,f),e.setCursor(f.line,f.ch))}if(s){if(d.lastSel){y=g;var S=d.lastSel,E=n(S.head.line-S.anchor.line),k=n(S.head.ch-S.anchor.ch);f=S.visualLine?l(g.line+E,g.ch):S.visualBlock?l(g.line+E,g.ch+k):S.head.line==S.anchor.line?l(g.line,g.ch+k):l(g.line+E,g.ch),t.visualMode=!0,t.visualLine=S.visualLine,t.visualBlock=S.visualBlock,c=t.sel={anchor:y,head:f},ie(e)}else t.visualMode&&(d.lastSel={anchor:j(c.anchor),head:j(c.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var T,w,I,N,A;if(!t.visualMode){if(T=j(y||g),w=j(f||m),K(w,T)){var L=T;T=w,w=L}I=a.linewise||d.linewise,I?ce(e,T,w):a.forward&&pe(e,T,w),N='char';var O=!a.inclusive||I;A=se(e,{anchor:T,head:w},N,O)}else if(T=G(c.head,c.anchor),w=X(c.head,c.anchor),I=t.visualLine||d.linewise,N=t.visualBlock?'block':I?'line':'char',A=se(e,{anchor:T,head:w},N),I){var P=A.ranges;if('block'==N)for(var D=0;Dp&&r.line==p?this.moveToEol(e,t,n,o):(n.toFirstChar&&(a=ue(e.getLine(s)),o.lastHPos=a),o.lastHSPos=e.charCoords(l(s,a),'div').left,l(s,a))},moveByDisplayLines:function(e,t,n,o){var r=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(r,'div').left;}var a=n.repeat,i=e.findPosV(r,n.forward?a:-a,'line',o.lastHSPos);if(i.hitSide)if(n.forward)var s=e.charCoords(i,'div'),d={top:s.top+8,left:o.lastHSPos},i=e.coordsChar(d,'div');else{var p=e.charCoords(l(e.firstLine(),0),'div');p.left=o.lastHSPos,i=e.coordsChar(p,'div')}return o.lastHPos=i.ch,i},moveByPage:function(e,t,n){var o=n.repeat;return e.findPosV(t,n.forward?o:-o,'page')},moveByParagraph:function(e,t,n){var o=n.forward?1:-1;return Ee(e,t,n.repeat,o)},moveByScroll:function(e,t,n,o){var r=e.getScrollInfo(),a=null,i=n.repeat;i||(i=r.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,'local');n.repeat=i;var a=kt.moveByDisplayLines(e,t,n,o);if(!a)return null;var d=e.charCoords(a,'local');return e.scrollTo(null,r.top+d.top-s.top),a},moveByWords:function(e,t,n){return be(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var o=n.repeat,r=ve(e,o,n.forward,n.selectedCharacter),a=n.forward?-1:1;return(ge(a,n),!r)?null:(r.ch+=a,r)},moveToCharacter:function(e,t,n){var o=n.repeat;return ge(0,n),ve(e,o,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var o=n.repeat;return fe(e,o,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,o){var r=n.repeat;return o.lastHPos=r-1,o.lastHSPos=e.charCoords(t,'div').left,xe(e,r)},moveToEol:function(e,t,n,o){o.lastHPos=Infinity;var r=l(t.line+n.repeat-1,Infinity),a=e.clipPos(r);return a.ch--,o.lastHSPos=e.charCoords(a,'div').left,r},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return l(n.line,ue(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n=t,o=n.line,r=n.ch,a=e.getLine(o),i;do if(i=a.charAt(r++),i&&v(i)){var s=e.getTokenTypeAt(l(o,r));if('string'!==s&&'comment'!==s)break}while(i);if(i){var d=e.findMatchingBracket(l(o,r));return d.to}return n},moveToStartOfLine:function(e,t){return l(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption('firstLineNumber')),l(o,ue(e.getLine(o)))},textObjectManipulation:function(e,t,n,o){var r=n.selectedCharacter;'b'==r?r='(':'B'==r&&(r='{');var a=!n.textObjectInner,i;if({"(":')',")":'(',"{":'}',"}":'{',"[":']',"]":'['}[r])i=ke(e,t,r,a);else if({"'":!0,'"':!0}[r])i=Te(e,t,r,a);else if('W'===r)i=he(e,a,!0,!0);else if('w'===r)i=he(e,a,!0,!1);else{if('p'!==r)return null;if(i=Ee(e,t,n.repeat,0,a),n.linewise=!0,o.visualMode)o.visualLine||(o.visualLine=!0);else{var s=o.inputState.operatorArgs;s&&(s.linewise=!0),i.end.line--}}return e.state.vim.visualMode?ae(e,i.start,i.end):[i.start,i.end]},repeatLastCharacterSearch:function(e,t,n){var o=Ct.lastCharacterSearch,r=n.repeat,a=n.forward===o.forward,i=(o.increment?1:0)*(a?-1:1);e.moveH(-i,'char'),n.inclusive=!!a;var s=ve(e,r,a,o.selectedCharacter);return s?(s.ch+=i,s):(e.moveH(i,'char'),t)}},Tt={change:function(e,n,o){var r=Number.MAX_VALUE,a=e.state.vim,i,s;if(Ct.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,!a.visualMode){var d=o[0].anchor,p=o[0].head;s=e.getRange(d,p);var c=a.lastEditInputState||{};if('moveByWords'==c.motion&&!S(s)){var u=/\s+$/.exec(s);u&&c.motionArgs&&c.motionArgs.forward&&(p=B(p,0,-u[0].length),s=s.slice(0,-u[0].length))}var h=new l(d.line-1,r),m=e.firstLine()==e.lastLine();p.line>e.lastLine()&&n.linewise&&!m?e.replaceRange('',h,p):e.replaceRange('',d,p),n.linewise&&(!m&&(e.setCursor(h),t.commands.newlineAndIndent(e)),d.ch=r),i=d}else{s=e.getSelection();var g=_('',o.length);e.replaceSelections(g),i=G(o[0].head,o[0].anchor)}Ct.registerController.pushText(n.registerName,'change',s,n.linewise,1p.top?(l.line+=(d-p.top)/a,l.line=Math.ceil(l.line),e.setCursor(l),p=e.charCoords(l,'local'),e.scrollTo(null,p.top)):e.scrollTo(null,d);else{var c=d+e.getScrollInfo().clientHeight;c=d.anchor.line?p=B(d.head,0,1):p=l(d.anchor.line,0);else if('inplace'==s&&i.visualMode)return;e.setOption('disableInput',!1),r&&r.replace?(e.toggleOverwrite(!0),e.setOption('keyMap','vim-replace'),t.signal(e,'vim-mode-change',{mode:'replace'})):(e.toggleOverwrite(!1),e.setOption('keyMap','vim-insert'),t.signal(e,'vim-mode-change',{mode:'insert'})),Ct.macroModeState.isPlaying||(e.on('change',et),t.on(e.getInputField(),'keydown',at)),i.visualMode&&le(e),te(e,p,c)}},toggleVisualMode:function(e,n,o){var r=n.repeat,a=e.getCursor(),i;o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,t.signal(e,'vim-mode-change',{mode:'visual',subMode:o.visualLine?'linewise':o.visualBlock?'blockwise':''}),ie(e)):le(e):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=M(e,l(a.line,a.ch+r-1),!0),o.sel={anchor:a,head:i},t.signal(e,'vim-mode-change',{mode:'visual',subMode:o.visualLine?'linewise':o.visualBlock?'blockwise':''}),ie(e),Ce(e,o,'<',G(a,i)),Ce(e,o,'>',X(a,i)))},reselectLastSelection:function(e,n,o){var r=o.lastSelection;if(o.visualMode&&re(e,o),r){var a=r.anchorMark.find(),i=r.headMark.find();if(!a||!i)return;o.sel={anchor:a,head:i},o.visualMode=!0,o.visualLine=r.visualLine,o.visualBlock=r.visualBlock,ie(e),Ce(e,o,'<',G(a,i)),Ce(e,o,'>',X(a,i)),t.signal(e,'vim-mode-change',{mode:'visual',subMode:o.visualLine?'linewise':o.visualBlock?'blockwise':''})}},joinLines:function(e,t,n){var r,a;if(n.visualMode){if(r=e.getCursor('anchor'),a=e.getCursor('head'),K(a,r)){var s=a;a=r,r=s}a.ch=Y(e,a.line)-1}else{var d=o(t.repeat,2);r=e.getCursor(),a=M(e,l(r.line+d-1,Infinity))}for(var p=0,c=r.line;cn)return'';if(e.getOption('indentWithTabs')){var o=r(n/d);return Array(o+1).join('\t')}return Array(n+1).join(' ')});s+=m?'\n':''}if(1e.lastLine()&&e.replaceRange('\n',l(I,0));var N=Y(e,I);Np.length&&(s=p.length),d=l(a.line,s)}if('\n'==r)o.visualMode||e.replaceRange('',a,d),(t.commands.newlineAndIndentContinueComment||t.commands.newlineAndIndent)(e);else{var c=e.getRange(a,d);if(c=c.replace(/[^\n]/g,r),o.visualBlock){var u=Array(e.getOption('tabSize')+1).join(' ');c=e.getSelection(),c=c.replace(/\t/g,u).replace(/[^\n]/g,r).split('\n'),e.replaceSelections(c)}else e.replaceRange(c,a,d);o.visualMode?(a=K(i[0].anchor,i[0].head)?i[0].anchor:i[0].head,e.setCursor(a),le(e,!1)):e.setCursor(B(d,0,-1))}},incrementNumberToken:function(e,t){for(var n=e.getCursor(),o=e.getLine(n.line),r=/-?\d+/g,a,i,s,d,p;null!==(a=r.exec(o))&&(p=a[0],i=a.index,s=i+p.length,!(n.cht.args.length?void _e(e,e.getOption('theme')):void e.setOption('theme',t.args[0])},map:function(e,t,n){var o=t.args;return!o||2>o.length?void(e&&_e(e,'Invalid mapping: '+t.input)):void Dt.map(o[0],o[1],n)},imap:function(e,t){this.map(e,t,'insert')},nmap:function(e,t){this.map(e,t,'normal')},vmap:function(e,t){this.map(e,t,'visual')},unmap:function(e,t,n){var o=t.args;return!o||1>o.length?void(e&&_e(e,'No such mapping: '+t.input)):void Dt.unmap(o[0],n)},move:function(e,t){Et.processCommand(e,e.state.vim,{type:'motion',motion:'moveToLineOrEdgeOfDocument',motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,o=t.setCfg||{};if(!n||1>n.length)return void(e&&_e(e,'Invalid mapping: '+t.input));var r=n[0].split('='),a=r[0],i=r[1],s=!1;if('?'==a.charAt(a.length-1)){if(i)throw Error('Trailing characters: '+t.argString);a=a.substring(0,a.length-1),s=!0}void 0===i&&'no'==a.substring(0,2)&&(a=a.substring(2),i=!1);var d=bt[a]&&'boolean'==bt[a].type;if(d&&void 0==i&&(i=!0),!d&&void 0===i||s){var l=w(a,e,o);!0===l||!1===l?_e(e,' '+(l?'':'no')+a):_e(e,' '+a+'='+l)}else T(a,i,e,o)},setlocal:function(e,t){t.setCfg={scope:'local'},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:'global'},this.set(e,t)},registers:function(e,t){var n=t.args,o=Ct.registerController.registers,r='----------Registers----------

';if(!n)for(var a in o){var s=o[a].toString();s.length&&(r+='"'+a+' '+s+'
')}else{var a;n=n.join('');for(var d=0;d'}}_e(e,r)},sort:function(e,n){function o(e,t){if(s){var n;n=e,e=t,t=n}d&&(e=e.toLowerCase(),t=t.toLowerCase());var o=c&&v.exec(e),r=c&&v.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),x),r=parseInt((r[1]+r[2]).toLowerCase(),x),o-r):e');if(!d)return void _e(e,c);var h=0,m=function(){if(h=c)return void _e(n,'Invalid argument: '+o.argString.substring(i));for(var u=0,h;u<=c-p;u++)h=e(p+u),delete r.marks[h]}else return void _e(n,'Invalid argument: '+d+'-')}else delete r.marks[s]}}},Dt=new Ot;return t.keyMap.vim={attach:u,detach:c,call:h},k('insertModeEscKeysTimeout',200,'number'),t.keyMap['vim-insert']={fallthrough:['default'],attach:u,detach:c,call:h},t.keyMap['vim-replace']={Backspace:'goCharLeft',fallthrough:['vim-insert'],attach:u,detach:c,call:h},(A(),{buildKeyMap:function(){},getRegisterController:function(){return Ct.registerController},resetVimGlobalState_:A,getVimGlobalState_:function(){return Ct},maybeInitVimState_:N,suppressErrorLogging:!1,InsertModeKey:rt,map:function(e,t,n){Dt.map(e,t,n)},unmap:function(e,t){Dt.unmap(e,t)},setOption:T,getOption:w,defineOption:k,defineEx:function(e,t,n){if(!t)t=e;else if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Pt[e]=n,Dt.commandMap_[t]={name:e,shortName:t,type:'api'}},handleKey:function(e,t,n){var o=this.findKey(e,t,n);if('function'==typeof o)return o()},findKey:function(n,e,o){function r(){var t=Ct.macroModeState;if(t.isRecording){if('q'==e)return t.exitMacroRecordMode(),R(n),!0;'mapping'!=o&&Je(t,e)}}function a(){if(''==e)return R(n),d.visualMode?le(n):d.insertMode&&Xe(n),!0}function i(o){for(var r;o;)r=/<\w+-.+?>|<\w+>|./.exec(o),e=r[0],o=o.substring(r.index+e.length),t.Vim.handleKey(n,e,'mapping')}var d=N(n),l;return l=d.insertMode?function(){if(a())return!0;for(var t=d.inputState.keyBuffer+=e,o=1==e.length,r=Et.matchCommand(t,s,d.inputState,'insert');1=e}function a(e){return 47e}function s(e){return e===Tr||e===zr}function l(t){return t&&t!==Rr&&!s(t)&&!te(t)}function c(s,l,e){l=jr(s.length,_r(0,null==l?s.length:l)),null!=e&&!0!==e||(l=u(s,l));var n=new $r(s),i;n.pos=l;for(var r=[];!n.sol();){if(i=n.peek(),h(i))r.push(i);else if(!d(i)){if(t(r,Wr)||t(r,Br)){n.pos--;continue}if(Lr(n)||!p(i))break}else if(r.pop()!==Yr.get(i))break;n.pos--}if(!r.length&&n.pos!==l){var o=s.slice(n.pos,l).replace(/^[\*\+\>\^]+/,'');return{abbreviation:o,location:l-o.length}}}function u(t,e){for(te(t.charCodeAt(e))&&e++;h(t.charCodeAt(e));)e++;return e}function t(n,t){return-1!==n.indexOf(t)}function p(e){return 64e||96e||47e||Dr.has(e)}function d(e){return e===Fr||e===Pr||e===Ir}function h(e){return e===Wr||e===Ur||e===Br}function m(n,t){return t&&(n='upper'===t?n.toUpperCase():n.toLowerCase()),n}function g(n,o){return n instanceof Jr?n:'string'==typeof n?new Jr(n,o):n&&'object'==typeof n?new Jr(n.name,n.value,n.options):void 0}function f(e){return(e+'').trim()}function y(o,t,e){return o&&e.indexOf(o)===t}function b(e){return e===ia||e===sa}function v(e){return 47e}function x(o,t,e){return t=t||65,e=e||90,(o&=-33)>=t&&o<=e}function k(e){return v(e)||x(e)}function C(e){return 32===e||9===e||160===e}function w(e){return C(e)||10===e||13===e}function A(s,t,e,n){n=n?Object.assign({},$a,n):$a;var r=s.pos;if(s.eat(t)){for(var i=1,a;!s.eof();)if(!Ca(s,n))if((a=s.next())===t)i++;else if(!(a===e))a===n.escape&&s.next();else if(! --i)return s.start=r,!0;if(s.pos=r,n.throws)throw s.error('Unable to find matching pair for '+Or(t))}return!1}function O(o){var r={};o.charCodeAt(0)===ai&&(o=o.slice(1),r.implied=!0),o.charCodeAt(o.length-1)===ii&&(o=o.slice(0,o.length-1),r.boolean=!0);var e={name:o};return Object.keys(r).length&&(e.options=r),e}function _(n){var t=n.pos;if(n.eatWhile(S))return n.start=t,!0}function S(e){return!w(e)&&!b(e)&&e!==di&&e!==li&&e!==si}function E(e){return e.start=e.pos,e.eatWhile(q),e.current()}function q(e){return k(e)||45===e||58===e||36===e||64===e||33===e||95===e||37===e}function j(d){for(var t=new aa(d.trim()),n=new Kr,r=n,i=[],o;!t.eof();)if(!((o=t.peek())!==hi)){var e=new Kr,l=i.length?T(i)[0]:r;i.push([e,l,t.pos]),r=e,t.next()}else if(o!==mi){var p=ui(t);if(r.appendChild(p),t.eof())break;switch(t.peek()){case gi:t.next();continue;case fi:t.next(),r=p;continue;case yi:for(;t.eat(yi);)r=r.parent||r;continue;}}else{var a=i.pop();if(!a)throw t.error('Unexpected ")" group end');var c=a[0];if(r=a[1],t.next(),c.repeat=ei(t))r.appendChild(c);else{for(;c.firstChild;)r.appendChild(c.firstChild);t.eat(gi)}}if(i.length)throw t.pos=i.pop()[2],t.error('Expected group close');return n}function T(e){return e[e.length-1]}function M(o){if(o.repeat&&o.repeat.count){for(var t=1,e;tn&&(n=e.index)}),-1!==n&&(a.index=n+1),e}function Ct(d,l){if(null==d)return d;for(var e=[],t=function(e,t,n,o){return null==l[n]?'':t+l[n]+o},o='',a=0,i=0,s,n;i=t.get('inlineBreak'))return!0}for(var o=0,a=d.children.length;on?0:n}function Ut(a,t){var e=a.node;if(t.enabled&&t.trigger&&e.name)for(var n=a.node.attributes.reduce(function(n,t){return t.name&&null!=t.value&&(n[t.name.toUpperCase().replace(/-/g,'_')]=t.value),n},{}),r=0,i=t.trigger.length;rt?0:t}function zt(o,t){var e=o.node;return!e.isTextOnly&&e.value&&(o.beforeText=ho.test(e.value)?o.newline+o.indent+t.indent(1):' '),o}function Vt(o,t){if(null!=o.value&&ho.test(o.value)){var e=wt(o.value),n=t.indent(1),r=e.reduce(function(n,t){return _r(n,t.length)},0);return e.map(function(o,t){return''+(t?n:'')+Xt(o,r)+' |'}).join('\n')}return o.value}function Xt(n,t){for(;n.length>4).toString(16)}function ae(e){return se(e.toString(16),2)}function se(n,t){for(;n.length=r&&(r=a,n=o)}return n}function qe(o,a){var e=o&&'object'==typeof o?o[a]:o,n=(e||'').match(/^[\w-@]+/);return n?n[0]:e}function ze(o,t){for(var e=0,n=0;en&&(t=t.slice(0,n-1).concat(t.slice(n-1).join(', ')));t.length;){var r=t.shift(),i=e.fields.shift(),o=r.length-i.length;e.string=e.string.slice(0,i.location)+r+e.string.slice(i.location+i.length);for(var a=0,s=e.fields.length;aa.length)return a;a=a.slice();var t=a.length,e=/,$/,n=0;n=3=t?Be(0,1):6=t?Be(0,2):Be(1,4);for(var r=0,i=void 0;rgn(t,o.to):0<=gn(t,o.from)&&0>=gn(t,o.to)}function gn(n,t){return n.line-t.line||n.ch-t.ch}function fn(o,t,e){return Zt(o,Object.assign({syntax:an(t),field:xa},Cn(t),e))}function yn(n,t){return en(n,Object.assign({syntax:an(t)},Cn(t)))}function bn(n,t){return t=t||t.getCursor(),c(n.getLine(t.line),t.ch,!0)}function vn(n,o){try{return{ast:yn(n,o),abbreviation:n,snippet:fn(n,o)}}catch(e){return null}}function xn(d,t,l){var n=!1,p=0,o;try{o=fn(t,d,{field:function(o,t){return void 0===t&&(t=''),n||(n=!0,p=t.length,t=ya+t),t}})}catch(e){return!1}var e=d.getLine(l.from.line),r=e.match(/^\s+/);o=cn(d,o,r&&r[0]);var a=o.length;return n&&(a=o.indexOf(ya),o=o.slice(0,a)+o.slice(a+ya.length)),d.operation(function(){d.replaceRange(o,l.from,l.to);var t=d.indexFromPos(l.from),e=d.posFromIndex(a+t);return p?d.setSelection(e,{line:e.line,ch:e.ch+p}):d.setCursor(e),!0})}function Cn(o,t){var e=o.getModeAt(t||o.getCursor()),n=o.getOption('emmet'),r=n&&n.profile;return'xml'===e.name&&(r=Object.assign({selfClosingStyle:e.configuration},r)),Object.assign({profile:r,snippets:kn(o,an(o,t))},n)}function kn(o,t){var e=o.getOption('emmet');if(e)return on(t)?e.stylesheetSnippets:e.markupSnippets}function wn(n){var t=An(n,n.getCursor());t&&_n(n,t)||(Sn(n),ln(n)&&On(n,n.getCursor()))}function An(o,t){for(var e=o.findMarksAt(t),n=0;n\^\+\(\)]/.test(o[t-r.length-1]))?r:null}function Bn(e){return e===qa||e===za}function Dn(e){return 47e}function jn(o,t,e){return t=t||65,e=e||90,(o&=-33)>=t&&o<=e}function zn(e){return Dn(e)||jn(e)}function Vn(e){return 32===e||9===e||160===e}function Gn(e){return Vn(e)||10===e||13===e}function Hn(s,t,e,n){n=n?Object.assign({},Ra,n):Ra;var r=s.pos;if(s.eat(t)){for(var i=1,a;!s.eof();)if(!Ma(s,n))if((a=s.next())===t)i++;else if(!(a===e))a===n.escape&&s.next();else if(! --i)return s.start=r,!0;if(s.pos=r,n.throws)throw s.error('Unable to find matching pair for '+Or(t))}return!1}function Xn(o,t){var e=o.pos;return o.eatWhile(t)?new Wa(o,e,o.pos):void(o.pos=e)}function Qn(e){return Ia(e)||Fa(e,Kn)}function Yn(a){var t=a.pos;if(Ma(a)){var e=a.pos,i,n;a.pos=t,a.next(),i=a.start=a.pos,a.pos=e,a.backUp(1),n=a.pos;var r=Fa(a,i,n);return a.pos=e,r}return Ia(a)||$n(a)}function Kn(e){return e!==Da&&!Jn(e)&&!Gn(e)}function Jn(e){return e===Ya||e===Ba}function $n(e){return Fa(e,Zn)}function Zn(e){return!(isNaN(e)||Bn(e)||Gn(e)||Jn(e))}function er(e){return Fa(e,tr)}function tr(e){return zn(e)||e===Ha||e===Xa||e===Va||e===Za}function nr(o,t){for(var e=o.pos,n=0;n'))},new Map),u=[o],l,n,r;!e.eof();)if(!(l=ir(e)))e.next();else if(r=lr(l),'open'===l.type)n=new La(e,'tag',l),pr(u).addChild(n),s.has(r)?n.close=sr(e,s.get(r)):function(e,t){return e.selfClosing||!p.xml&&a.has(t)}(l,r)||u.push(n);else if('close'===l.type){for(var i=u.length-1;0','/'].map(Nr)),Yr=new Map().set(Fr,Wr).set(Pr,Ur).set(Ir,Br),Gr={indent:'\t',tagCase:'',attributeCase:'',attributeQuotes:'double',format:!0,formatSkip:['html'],formatForce:['body'],inlineBreak:3,compactBooleanAttributes:!1,booleanAttributes:['contenteditable','seamless','async','autofocus','autoplay','checked','controls','defer','disabled','formnovalidate','hidden','ismap','loop','multiple','muted','novalidate','readonly','required','reversed','selected','typemustmatch'],selfClosingStyle:'html',inlineElements:['a','abbr','acronym','applet','b','basefont','bdo','big','br','button','cite','code','del','dfn','em','font','i','iframe','img','input','ins','kbd','label','map','object','q','s','samp','select','small','span','strike','strong','sub','sup','textarea','tt','u','var']},Vr=function(e){this.options=Object.assign({},Gr,e),this.quoteChar='single'===this.options.attributeQuotes?'\'':'"'};Vr.prototype.get=function(e){return this.options[e]},Vr.prototype.quote=function(e){return''+this.quoteChar+(null==e?'':e)+this.quoteChar},Vr.prototype.name=function(e){return m(e,this.options.tagCase)},Vr.prototype.attribute=function(e){return m(e,this.options.attributeCase)},Vr.prototype.isBooleanAttribute=function(e){return e.options.boolean||-1!==this.get('booleanAttributes').indexOf((e.name||'').toLowerCase())},Vr.prototype.selfClose=function(){switch(this.options.selfClosingStyle){case'xhtml':return' /';case'xml':return'/';default:return'';}},Vr.prototype.indent=function(o){var t=this;o=o||0;for(var e='';o--;)e+=t.options.indent;return e},Vr.prototype.isInline=function(e){return'string'==typeof e?-1!==this.get('inlineElements').indexOf(e.toLowerCase()):null==e.name?e.isTextOnly:this.isInline(e.name)},Vr.prototype.field=function(n,t){return this.options.field(n,t)};var Xr=function(n,t){this.key=n,this.value=t},Hr=function(e){this._string=new Map,this._regexp=new Map,this._disabled=!1,this.load(e)},Zr={disabled:{}};Zr.disabled.get=function(){return this._disabled},Hr.prototype.disable=function(){this._disabled=!0},Hr.prototype.enable=function(){this._disabled=!1},Hr.prototype.set=function(o,r){var e=this;if('string'==typeof o)o.split('|').forEach(function(n){return e._string.set(n,new Xr(n,r))});else{if(!(o instanceof RegExp))throw new Error('Unknow snippet key: '+o);this._regexp.set(o,new Xr(o,r))}return this},Hr.prototype.get=function(o){var t=this;if(!this.disabled){if(this._string.has(o))return this._string.get(o);for(var e=Array.from(this._regexp.keys()),n=0,r=e.length;nt||t>this.children.length)throw new Error('Unable to insert node: position is out of child list range');var e=this.children[t-1],n=this.children[t];o.remove(),o.parent=this,this.children.splice(t,0,o),e&&(o.previous=e,e.next=o),n&&(o.next=n,n.previous=o)},Kr.prototype.removeChild=function(n){var t=this.children.indexOf(n);-1!==t&&(this.children.splice(t,1),n.previous&&(n.previous.next=n.next),n.next&&(n.next.previous=n.previous),n.parent=n.next=n.previous=null)},Kr.prototype.remove=function(){this.parent&&this.parent.removeChild(this)},Kr.prototype.clone=function(n){var o=new Kr(this.name);return o.value=this.value,o.selfClosing=this.selfClosing,this.repeat&&(o.repeat=Object.assign({},this.repeat)),this._attributes.forEach(function(e){return o.setAttribute(e.clone())}),n&&this.children.forEach(function(e){return o.appendChild(e.clone(!0))}),o},Kr.prototype.walk=function(o,t){t=t||0;for(var e=this.firstChild,n;e;){if(n=e.next,!1===o(e,t)||!1===e.walk(o,t+1))return!1;e=n}},Kr.prototype.use=function(o){for(var t=arguments,e=[this],n=1;n=this.end},aa.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},aa.prototype.peek=function(){return this.string.charCodeAt(this.pos)},aa.prototype.next=function(){if(this.pos'},lo=/^id$/i,co=/^class$/i,fo={primary:function(e){return e.join('')},secondary:function(e){return e.map(function(e){return e.isBoolean?e.name:e.name+'='+e.value}).join(', ')}},ji={open:null,close:null,omitName:/^div$/i,attributes:fo},ho=/\n|\r/,mo=/\n|\r/,go={none:'[ SECONDARY_ATTRS]',round:'[(SECONDARY_ATTRS)]',curly:'[{SECONDARY_ATTRS}]',square:'[[SECONDARY_ATTRS]'},bo=/\n|\r/,vo={html:function(o,a,e){return e=Object.assign({},e),e.comment=Object.assign({},uo,e.comment),bt(o,e.field,function(n){if(n=jt(n,a),!St(n)){var t=n.node;if(t.name){var r=a.name(t.name),i=Nt(n,a);n.open='<'+r+i+(t.selfClosing?a.selfClose():'')+'>',t.selfClosing||(n.close=''),Ut(n,e.comment)}!t.value&&(t.children.length||t.selfClosing)||(n.text=n.renderFields(t.value))}return n})},haml:function(o,a,e){e=e||{};var i={open:'[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]',selfClose:'/',attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?e.name+(a.get('compactBooleanAttributes')?'':'=true'):e.name+'='+a.quote(e.value)}).join(' ')}}};return bt(o,e.field,function(e){if(e=It(e,a,i),e=zt(e,a),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(Vt(t,a)))}return e})},slim:function(a,s,e){e=e||{};var t=e.attributeWrap&&go[e.attributeWrap]||go.none,n=t===go.none?function(e){return e.name+'=true'}:function(e){return e.name},i={open:'[NAME][PRIMARY_ATTRS]'+t+'[SELF_CLOSE]',selfClose:'/',attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?n(e):e.name+'='+s.quote(e.value)}).join(' ')}}};return bt(a,e.field,function(e){if(e=It(e,s,i),e=Ht(e,s),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(Qt(t,s)))}return e})},pug:function(o,a,e){e=e||{};var i={open:'[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]',attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?e.name:e.name+'='+a.quote(e.value)}).join(', ')}}};return bt(o,e.field,function(e){if(e=It(e,a,i),e=Kt(e,a),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(ee(t,a)))}return e})}},yo=function(o,t,e,a){return'object'==typeof e&&(a=e,e=null),ne(e)||(e='html'),vo[e](o,t,a)},xo=function(){this.type='css-value',this.value=[]},wo={size:{}};wo.size.get=function(){return this.value.length},xo.prototype.add=function(e){this.value.push(e)},xo.prototype.has=function(e){return-1!==this.value.indexOf(e)},xo.prototype.toString=function(){return this.value.join(' ')},Object.defineProperties(xo.prototype,wo);var ko=function(n){if(35===n.peek()){n.start=n.pos,n.next(),n.eat(116)||n.eatWhile(re);var t=n.current();if(n.start=n.pos,n.eat(46)&&!n.eatWhile(v))throw n.error('Unexpected character for alpha value of color');return new $o(t,n.current())}},$o=function(o,t){this.type='color',this.raw=o,this.alpha=+(null!=t&&''!==t?t:1),o=o.slice(1);var e=0,n=0,r=0;if('t'===o)this.alpha=0;else switch(o.length){case 0:break;case 1:e=n=r=o+o;break;case 2:e=n=r=o;break;case 3:e=o[0]+o[0],n=o[1]+o[1],r=o[2]+o[2];break;default:o+=o,e=o.slice(0,2),n=o.slice(2,4),r=o.slice(4,6);}this.r=parseInt(e,16),this.g=parseInt(n,16),this.b=parseInt(r,16)};$o.prototype.toHex=function(n){var t=n&&ie(this.r)&&ie(this.g)&&ie(this.b)?oe:ae;return'#'+t(this.r)+t(this.g)+t(this.b)},$o.prototype.toRGB=function(){var e=[this.r,this.g,this.b];return 1!==this.alpha&&e.push(this.alpha.toFixed(8).replace(/\.?0+$/,'')),(3===e.length?'rgb':'rgba')+'('+e.join(', ')+')'},$o.prototype.toString=function(e){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(e):this.toRGB():'transparent'};var Co=46,Ao=45,Oo=function(n){if(n.start=n.pos,ce(n)){var t=n.current();return n.start=n.pos,n.eat(37)||n.eatWhile(le),new jo(t,n.current())}},jo=function(n,o){this.type='numeric',this.value=+n,this.unit=o||''};jo.prototype.toString=function(){return''+this.value+this.unit};var _o=45,So=function(n,t){return n.start=n.pos,n.eat(36)||n.eat(64)?n.eatWhile(pe):t?n.eatWhile(le):n.eatWhile(fe),n.start===n.pos?null:new Eo(n.current())},Eo=function(e){this.type='keyword',this.value=e};Eo.prototype.toString=function(){return this.value};var qo={throws:!0},zo=function(e){if(Ca(e,qo))return new To(e.current())},To=function(e){this.type='string',this.value=e};To.prototype.toString=function(){return this.value};var Mo=40,Ro=41,Lo=44,No=function(n,t){this.type='function',this.name=n,this.args=t||[]};No.prototype.toString=function(){return this.name+'('+this.args.join(', ')+')'};var Fo=33,Wo=36,Po=45,Uo=58,Io=64,Bo=function(a){for(var t=new Kr,e=new aa(a),n;!e.eof();){n=new Kr(ge(e)),n.value=be(e);var r=he(e);if(r)for(var i=0;isrc:m+img',"ri:t|ri:type":'pic>src:t+img',"!!!":'{}',doc:'html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body',"!|html:5":'!!!+doc',c:'{}',"cc:ie":'{}',"cc:noie":'{${0}}'},css:{"@f":'@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}',"@ff":'@font-face {\n\tfont-family: \'${1:FontName}\';\n\tsrc: url(\'${2:FileName}.eot\');\n\tsrc: url(\'${2:FileName}.eot?#iefix\') format(\'embedded-opentype\'),\n\t\t url(\'${2:FileName}.woff\') format(\'woff\'),\n\t\t url(\'${2:FileName}.ttf\') format(\'truetype\'),\n\t\t url(\'${2:FileName}.svg#${1:FontName}\') format(\'svg\');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}',"@i|@import":'@import url(${0});',"@kf":'@keyframes ${1:identifier} {\n\t${2}\n}',"@m|@media":'@media ${1:screen} {\n\t${0}\n}',ac:'align-content:flex-start|flex-end|center|space-between|space-around|stretch',ai:'align-items:flex-start|flex-end|center|baseline|stretch',anim:'animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}',animdel:'animation-delay:${1:time}',animdir:'animation-direction:normal|reverse|alternate|alternate-reverse',animdur:'animation-duration:${1:0}s',animfm:'animation-fill-mode:both|forwards|backwards',animic:'animation-iteration-count:1|infinite',animn:'animation-name',animps:'animation-play-state:running|paused',animtf:'animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})',ap:'appearance:none',as:'align-self:auto|flex-start|flex-end|center|baseline|stretch',b:'bottom',bd:'border:${1:1px} ${2:solid} ${3:#000}',bdb:'border-bottom:${1:1px} ${2:solid} ${3:#000}',bdbc:'border-bottom-color:#${1:000}',bdbi:'border-bottom-image:url(${0})',bdbk:'border-break:close',bdbli:'border-bottom-left-image:url(${0})|continue',bdblrs:'border-bottom-left-radius',bdbri:'border-bottom-right-image:url(${0})|continue',bdbrrs:'border-bottom-right-radius',bdbs:'border-bottom-style',bdbw:'border-bottom-width',bdc:'border-color:#${1:000}',bdci:'border-corner-image:url(${0})|continue',bdcl:'border-collapse:collapse|separate',bdf:'border-fit:repeat|clip|scale|stretch|overwrite|overflow|space',bdi:'border-image:url(${0})',bdl:'border-left:${1:1px} ${2:solid} ${3:#000}',bdlc:'border-left-color:#${1:000}',bdlen:'border-length',bdli:'border-left-image:url(${0})',bdls:'border-left-style',bdlw:'border-left-width',bdr:'border-right:${1:1px} ${2:solid} ${3:#000}',bdrc:'border-right-color:#${1:000}',bdri:'border-right-image:url(${0})',bdrs:'border-radius',bdrst:'border-right-style',bdrw:'border-right-width',bds:'border-style:hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset',bdsp:'border-spacing',bdt:'border-top:${1:1px} ${2:solid} ${3:#000}',bdtc:'border-top-color:#${1:000}',bdti:'border-top-image:url(${0})',bdtli:'border-top-left-image:url(${0})|continue',bdtlrs:'border-top-left-radius',bdtri:'border-top-right-image:url(${0})|continue',bdtrrs:'border-top-right-radius',bdts:'border-top-style',bdtw:'border-top-width',bdw:'border-width',bfv:'backface-visibility:hidden|visible',bg:'background:#${1:000}',bga:'background-attachment:fixed|scroll',bgbk:'background-break:bounding-box|each-box|continuous',bgc:'background-color:#${1:fff}',bgcp:'background-clip:padding-box|border-box|content-box|no-clip',bgi:'background-image:url(${0})',bgo:'background-origin:padding-box|border-box|content-box',bgp:'background-position:${1:0} ${2:0}',bgpx:'background-position-x',bgpy:'background-position-y',bgr:'background-repeat:no-repeat|repeat-x|repeat-y|space|round',bgsz:'background-size:contain|cover',bxsh:'box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:color}|none',bxsz:'box-sizing:border-box|content-box|border-box',c:'color:#${1:000}',cl:'clear:both|left|right|none',cm:'/* ${0} */',cnt:'content:\'${0}\'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})',coi:'counter-increment',colm:'columns',colmc:'column-count',colmf:'column-fill',colmg:'column-gap',colmr:'column-rule',colmrc:'column-rule-color',colmrs:'column-rule-style',colmrw:'column-rule-width',colms:'column-span',colmw:'column-width',cor:'counter-reset',cp:'clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})',cps:'caption-side:top|bottom',cur:'cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text',d:'display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group',ec:'empty-cells:show|hide',f:'font:${1:1em} ${2:sans-serif}',fef:'font-effect:none|engrave|emboss|outline',fem:'font-emphasize',femp:'font-emphasize-position:before|after',fems:'font-emphasize-style:none|accent|dot|circle|disc',ff:'font-family:serif|sans-serif|cursive|fantasy|monospace',fl:'float:left|right|none',fs:'font-style:italic|normal|oblique',fsm:'font-smoothing:antialiased|subpixel-antialiased|none',fst:'font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded',fv:'font-variant:normal|small-caps',fw:'font-weight:normal|bold|bolder|lighter',fx:'flex',fxb:'flex-basis:fill|max-content|min-content|fit-content|content',fxd:'flex-direction:row|row-reverse|column|column-reverse',fxf:'flex-flow',fxg:'flex-grow',fxsh:'flex-shrink',fxw:'flex-wrap:nowrap|wrap|wrap-reverse',fz:'font-size',fza:'font-size-adjust',h:'height',jc:'justify-content:flex-start|flex-end|center|space-between|space-around',l:'left',lg:'background-image:linear-gradient(${1})',lh:'line-height',lis:'list-style',lisi:'list-style-image',lisp:'list-style-position:inside|outside',list:'list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman',lts:'letter-spacing:normal',m:'margin',mah:'max-height',mar:'max-resolution',maw:'max-width',mb:'margin-bottom',mih:'min-height',mir:'min-resolution',miw:'min-width',ml:'margin-left',mr:'margin-right',mt:'margin-top',ol:'outline',olc:'outline-color:#${1:000}|invert',olo:'outline-offset',ols:'outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset',olw:'outline-width|thin|medium|thick',op:'opacity',ord:'order',ori:'orientation:landscape|portrait',orp:'orphans',ov:'overflow:hidden|visible|hidden|scroll|auto',ovs:'overflow-style:scrollbar|auto|scrollbar|panner|move|marquee',ovx:'overflow-x:hidden|visible|hidden|scroll|auto',ovy:'overflow-y:hidden|visible|hidden|scroll|auto',p:'padding',pb:'padding-bottom',pgba:'page-break-after:auto|always|left|right',pgbb:'page-break-before:auto|always|left|right',pgbi:'page-break-inside:auto|avoid',pl:'padding-left',pos:'position:relative|absolute|relative|fixed|static',pr:'padding-right',pt:'padding-top',q:'quotes',qen:'quotes:\'\\201C\' \'\\201D\' \'\\2018\' \'\\2019\'',qru:'quotes:\'\\00AB\' \'\\00BB\' \'\\201E\' \'\\201C\'',r:'right',rsz:'resize:none|both|horizontal|vertical',t:'top',ta:'text-align:left|center|right|justify',tal:'text-align-last:left|center|right',tbl:'table-layout:fixed',td:'text-decoration:none|underline|overline|line-through',te:'text-emphasis:none|accent|dot|circle|disc|before|after',th:'text-height:auto|font-size|text-size|max-size',ti:'text-indent',tj:'text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan',to:'text-outline:${1:0} ${2:0} ${3:#000}',tov:'text-overflow:ellipsis|clip',tr:'text-replace',trf:'transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})',trfo:'transform-origin',trfs:'transform-style:preserve-3d',trs:'transition:${1:prop} ${2:time}',trsde:'transition-delay:${1:time}',trsdu:'transition-duration:${1:time}',trsp:'transition-property:${1:prop}',trstf:'transition-timing-function:${1:fn}',tsh:'text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}',tt:'text-transform:uppercase|lowercase|capitalize|none',tw:'text-wrap:none|normal|unrestricted|suppress',us:'user-select:none',v:'visibility:hidden|visible|collapse',va:'vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub',w:'width',whs:'white-space:nowrap|pre|pre-wrap|pre-line|normal',whsc:'white-space-collapse:normal|keep-all|loose|break-strict|break-all',wid:'widows',wm:'writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl',wob:'word-break:normal|keep-all|break-all',wos:'word-spacing',wow:'word-wrap:none|unrestricted|suppress|break-word|normal',z:'z-index',zom:'zoom:1'}},oa={latin:{common:['lorem','ipsum','dolor','sit','amet','consectetur','adipisicing','elit'],words:['exercitationem','perferendis','perspiciatis','laborum','eveniet','sunt','iure','nam','nobis','eum','cum','officiis','excepturi','odio','consectetur','quasi','aut','quisquam','vel','eligendi','itaque','non','odit','tempore','quaerat','dignissimos','facilis','neque','nihil','expedita','vitae','vero','ipsum','nisi','animi','cumque','pariatur','velit','modi','natus','iusto','eaque','sequi','illo','sed','ex','et','voluptatibus','tempora','veritatis','ratione','assumenda','incidunt','nostrum','placeat','aliquid','fuga','provident','praesentium','rem','necessitatibus','suscipit','adipisci','quidem','possimus','voluptas','debitis','sint','accusantium','unde','sapiente','voluptate','qui','aspernatur','laudantium','soluta','amet','quo','aliquam','saepe','culpa','libero','ipsa','dicta','reiciendis','nesciunt','doloribus','autem','impedit','minima','maiores','repudiandae','ipsam','obcaecati','ullam','enim','totam','delectus','ducimus','quis','voluptates','dolores','molestiae','harum','dolorem','quia','voluptatem','molestias','magni','distinctio','omnis','illum','dolorum','voluptatum','ea','quas','quam','corporis','quae','blanditiis','atque','deserunt','laboriosam','earum','consequuntur','hic','cupiditate','quibusdam','accusamus','ut','rerum','error','minus','eius','ab','ad','nemo','fugit','officia','at','in','id','quos','reprehenderit','numquam','iste','fugiat','sit','inventore','beatae','repellendus','magnam','recusandae','quod','explicabo','doloremque','aperiam','consequatur','asperiores','commodi','optio','dolor','labore','temporibus','repellat','veniam','architecto','est','esse','mollitia','nulla','a','similique','eos','alias','dolore','tenetur','deleniti','porro','facere','maxime','corrupti']},ru:{common:['\u0434\u0430\u043B\u0435\u043A\u043E-\u0434\u0430\u043B\u0435\u043A\u043E','\u0437\u0430','\u0441\u043B\u043E\u0432\u0435\u0441\u043D\u044B\u043C\u0438','\u0433\u043E\u0440\u0430\u043C\u0438','\u0432 \u0441\u0442\u0440\u0430\u043D\u0435','\u0433\u043B\u0430\u0441\u043D\u044B\u0445','\u0438 \u0441\u043E\u0433\u043B\u0430\u0441\u043D\u044B\u0445','\u0436\u0438\u0432\u0443\u0442','\u0440\u044B\u0431\u043D\u044B\u0435','\u0442\u0435\u043A\u0441\u0442\u044B'],words:['\u0432\u0434\u0430\u043B\u0438','\u043E\u0442 \u0432\u0441\u0435\u0445','\u043E\u043D\u0438','\u0431\u0443\u043A\u0432\u0435\u043D\u043D\u044B\u0445','\u0434\u043E\u043C\u0430\u0445','\u043D\u0430 \u0431\u0435\u0440\u0435\u0433\u0443','\u0441\u0435\u043C\u0430\u043D\u0442\u0438\u043A\u0430','\u0431\u043E\u043B\u044C\u0448\u043E\u0433\u043E','\u044F\u0437\u044B\u043A\u043E\u0432\u043E\u0433\u043E','\u043E\u043A\u0435\u0430\u043D\u0430','\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0438\u0439','\u0440\u0443\u0447\u0435\u0435\u043A','\u0434\u0430\u043B\u044C','\u0436\u0443\u0440\u0447\u0438\u0442','\u043F\u043E \u0432\u0441\u0435\u0439','\u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0432\u0430\u0435\u0442','\u0435\u0435','\u0432\u0441\u0435\u043C\u0438','\u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u043C\u0438','\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u043C\u0438','\u044D\u0442\u0430','\u043F\u0430\u0440\u0430\u0434\u0438\u0433\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F','\u0441\u0442\u0440\u0430\u043D\u0430','\u043A\u043E\u0442\u043E\u0440\u043E\u0439','\u0436\u0430\u0440\u0435\u043D\u043D\u044B\u0435','\u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F','\u0437\u0430\u043B\u0435\u0442\u0430\u044E\u0442','\u043F\u0440\u044F\u043C\u043E','\u0440\u043E\u0442','\u0434\u0430\u0436\u0435','\u0432\u0441\u0435\u043C\u043E\u0433\u0443\u0449\u0430\u044F','\u043F\u0443\u043D\u043A\u0442\u0443\u0430\u0446\u0438\u044F','\u043D\u0435','\u0438\u043C\u0435\u0435\u0442','\u0432\u043B\u0430\u0441\u0442\u0438','\u043D\u0430\u0434','\u0440\u044B\u0431\u043D\u044B\u043C\u0438','\u0442\u0435\u043A\u0441\u0442\u0430\u043C\u0438','\u0432\u0435\u0434\u0443\u0449\u0438\u043C\u0438','\u0431\u0435\u0437\u043E\u0440\u0444\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u043D\u044B\u0439','\u043E\u0431\u0440\u0430\u0437','\u0436\u0438\u0437\u043D\u0438','\u043E\u0434\u043D\u0430\u0436\u0434\u044B','\u043E\u0434\u043D\u0430','\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0430\u044F','\u0441\u0442\u0440\u043E\u0447\u043A\u0430','\u0440\u044B\u0431\u043D\u043E\u0433\u043E','\u0442\u0435\u043A\u0441\u0442\u0430','\u0438\u043C\u0435\u043D\u0438','lorem','ipsum','\u0440\u0435\u0448\u0438\u043B\u0430','\u0432\u044B\u0439\u0442\u0438','\u0431\u043E\u043B\u044C\u0448\u043E\u0439','\u043C\u0438\u0440','\u0433\u0440\u0430\u043C\u043C\u0430\u0442\u0438\u043A\u0438','\u0432\u0435\u043B\u0438\u043A\u0438\u0439','\u043E\u043A\u0441\u043C\u043E\u043A\u0441','\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0430\u043B','\u043E','\u0437\u043B\u044B\u0445','\u0437\u0430\u043F\u044F\u0442\u044B\u0445','\u0434\u0438\u043A\u0438\u0445','\u0437\u043D\u0430\u043A\u0430\u0445','\u0432\u043E\u043F\u0440\u043E\u0441\u0430','\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0445','\u0442\u043E\u0447\u043A\u0430\u0445','\u0437\u0430\u043F\u044F\u0442\u043E\u0439','\u043D\u043E','\u0442\u0435\u043A\u0441\u0442','\u0434\u0430\u043B','\u0441\u0431\u0438\u0442\u044C','\u0441\u0435\u0431\u044F','\u0442\u043E\u043B\u043A\u0443','\u043E\u043D','\u0441\u043E\u0431\u0440\u0430\u043B','\u0441\u0435\u043C\u044C','\u0441\u0432\u043E\u0438\u0445','\u0437\u0430\u0433\u043B\u0430\u0432\u043D\u044B\u0445','\u0431\u0443\u043A\u0432','\u043F\u043E\u0434\u043F\u043E\u044F\u0441\u0430\u043B','\u0438\u043D\u0438\u0446\u0438\u0430\u043B','\u0437\u0430','\u043F\u043E\u044F\u0441','\u043F\u0443\u0441\u0442\u0438\u043B\u0441\u044F','\u0434\u043E\u0440\u043E\u0433\u0443','\u0432\u0437\u043E\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044C','\u043F\u0435\u0440\u0432\u0443\u044E','\u0432\u0435\u0440\u0448\u0438\u043D\u0443','\u043A\u0443\u0440\u0441\u0438\u0432\u043D\u044B\u0445','\u0433\u043E\u0440','\u0431\u0440\u043E\u0441\u0438\u043B','\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439','\u0432\u0437\u0433\u043B\u044F\u0434','\u043D\u0430\u0437\u0430\u0434','\u0441\u0438\u043B\u0443\u044D\u0442','\u0441\u0432\u043E\u0435\u0433\u043E','\u0440\u043E\u0434\u043D\u043E\u0433\u043E','\u0433\u043E\u0440\u043E\u0434\u0430','\u0431\u0443\u043A\u0432\u043E\u0433\u0440\u0430\u0434','\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A','\u0434\u0435\u0440\u0435\u0432\u043D\u0438','\u0430\u043B\u0444\u0430\u0432\u0438\u0442','\u043F\u043E\u0434\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A','\u0441\u0432\u043E\u0435\u0433\u043E','\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430','\u0433\u0440\u0443\u0441\u0442\u043D\u044B\u0439','\u0440\u0435\u0442\u043E\u0440\u0438\u0447\u0435\u0441\u043A\u0438\u0439','\u0432\u043E\u043F\u0440\u043E\u0441','\u0441\u043A\u0430\u0442\u0438\u043B\u0441\u044F','\u0435\u0433\u043E','\u0449\u0435\u043A\u0435','\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B','\u0441\u0432\u043E\u0439','\u043F\u0443\u0442\u044C','\u0434\u043E\u0440\u043E\u0433\u0435','\u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043B','\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u044C','\u043E\u043D\u0430','\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0434\u0438\u043B\u0430','\u043C\u043E\u0435\u0439','\u0432\u0441\u0435','\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u0442\u0441\u044F','\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E','\u0440\u0430\u0437','\u0435\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435','\u0447\u0442\u043E','\u043C\u0435\u043D\u044F','\u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C','\u044D\u0442\u043E','\u043F\u0440\u0438\u0441\u0442\u0430\u0432\u043A\u0430','\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0441\u044F','\u0442\u044B','\u043B\u0443\u0447\u0448\u0435','\u0441\u0432\u043E\u044E','\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0443\u044E','\u0441\u0442\u0440\u0430\u043D\u0443','\u043F\u043E\u0441\u043B\u0443\u0448\u0430\u0432\u0448\u0438\u0441\u044C','\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u0438','\u043D\u0430\u0448','\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B','\u0441\u0432\u043E\u0439','\u043F\u0443\u0442\u044C','\u0432\u0441\u043A\u043E\u0440\u0435','\u0435\u043C\u0443','\u043F\u043E\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043B\u0441\u044F','\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0439','\u0441\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C','\u0440\u0435\u043A\u043B\u0430\u043C\u043D\u044B\u0445','\u0442\u0435\u043A\u0441\u0442\u043E\u0432','\u043D\u0430\u043F\u043E\u0438\u0432\u0448\u0438\u0439','\u044F\u0437\u044B\u043A\u043E\u043C','\u0440\u0435\u0447\u044C\u044E','\u0437\u0430\u043C\u0430\u043D\u0438\u0432\u0448\u0438\u0439','\u0441\u0432\u043E\u0435','\u0430\u0433\u0435\u043D\u0442\u0441\u0442\u0432\u043E','\u043A\u043E\u0442\u043E\u0440\u043E\u0435','\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B\u043E','\u0441\u043D\u043E\u0432\u0430','\u0441\u043D\u043E\u0432\u0430','\u0441\u0432\u043E\u0438\u0445','\u043F\u0440\u043E\u0435\u043A\u0442\u0430\u0445','\u0435\u0441\u043B\u0438','\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u0430\u043B\u0438','\u0442\u043E','\u0436\u0438\u0432\u0435\u0442','\u0442\u0430\u043C','\u0434\u043E','\u0441\u0438\u0445','\u043F\u043E\u0440']},sp:{common:['mujer','uno','dolor','m\xE1s','de','poder','mismo','si'],words:['ejercicio','preferencia','perspicacia','laboral','pa\xF1o','suntuoso','molde','namibia','planeador','mirar','dem\xE1s','oficinista','excepci\xF3n','odio','consecuencia','casi','auto','chicharra','velo','elixir','ataque','no','odio','temporal','cu\xF3rum','dign\xEDsimo','facilismo','letra','nihilista','expedici\xF3n','alma','alveolar','aparte','le\xF3n','animal','como','paria','belleza','modo','natividad','justo','ataque','s\xE9quito','pillo','sed','ex','y','voluminoso','temporalidad','verdades','racional','asunci\xF3n','incidente','marejada','placenta','amanecer','fuga','previsor','presentaci\xF3n','lejos','necesariamente','sospechoso','adiposidad','quind\xEDo','p\xF3cima','voluble','d\xE9bito','sinti\xF3','accesorio','falda','sapiencia','volutas','queso','permacultura','laudo','soluciones','entero','pan','litro','tonelada','culpa','libertario','mosca','dictado','reincidente','nascimiento','dolor','escolar','impedimento','m\xEDnima','mayores','repugnante','dulce','obcecado','monta\xF1a','enigma','total','delet\xE9reo','d\xE9cima','c\xE1bala','fotograf\xEDa','dolores','molesto','olvido','paciencia','resiliencia','voluntad','molestias','magn\xEDfico','distinci\xF3n','ovni','marejada','cerro','torre','y','abogada','manantial','corporal','agua','crep\xFAsculo','ataque','desierto','laboriosamente','angustia','afortunado','alma','encefalograma','materialidad','cosas','o','renuncia','error','menos','conejo','abad\xEDa','analfabeto','remo','fugacidad','oficio','en','alm\xE1cigo','vos','pan','represi\xF3n','n\xFAmeros','triste','refugiado','trote','inventor','corchea','repelente','magma','recusado','patr\xF3n','expl\xEDcito','paloma','s\xEDndrome','inmune','autoinmune','comodidad','ley','vietnamita','demonio','tasmania','repeler','ap\xE9ndice','arquitecto','columna','yugo','computador','mula','a','prop\xF3sito','fantas\xEDa','alias','rayo','tenedor','deleznable','ventana','cara','anemia','corrupto']}},la={wordCount:30,skipCommon:!1,lang:'latin'},ca=function(o,t){t=Object.assign({},la,t);var e=oa[t.lang]||oa.latin,n=!t.skipCommon&&!Ze(o);return o.repeat||Ie(o.parent)?(o.value=He(e,t.wordCount,n),o.name=P(o.parent.name)):(o.parent.value=He(e,t.wordCount,n),o.remove()),o},fa=/^lorem([a-z]*)(\d*)$/,pa=function(o,t){var a=[na[o]||na.html];Array.isArray(t)?t.forEach(function(e){a.push('string'==typeof e?na[e]:e)}):'object'==typeof t&&a.push(t);var n=new Qr(a.filter(Boolean));return'css'!==o&&n.get(0).set(fa,$t),n},ha={lang:'en',locale:'en-US',charset:'UTF-8'},da=new Set(['css','sass','scss','less','stylus','sss']),ma={syntax:'html',field:function(n,t){return t||''},text:null,profile:null,variables:{},snippets:{},addons:null,format:null},ga=new Set(['html','xml','xsl','jsx','js','pug','slim','haml','css','sass','scss','less','sss','stylus']),ba=function(o,t){var e=o.getTokenTypeAt(t||o.getCursor());return e&&/^property\b/.test(e)},zi={html:function(n,t){return null===n.getTokenTypeAt(t||n.getCursor())},css:ba,less:ba,sass:ba,scss:ba},ya='[[::emmet-cursor::]]',xa=function(n,t){return void 0===t&&(t=''),t},Ki='emmet-abbreviation',Gi=45,Aa=function(e){return qn(e.map(function(e){return new Oa(e.key,e.value)}))},Oa=function(o,t){this.key=o,this.value=t,this.property=null;var e=t&&t.match(/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/);e&&(this.property=e[1],this.value=e[2]),this.dependencies=[]},ja={defaulValue:{}};Oa.prototype.addDependency=function(e){this.dependencies.push(e)},ja.defaulValue.get=function(){return null==this.value?null:Rn(this.value)[0]},Oa.prototype.keywords=function(){var d=[],n=new Set,r=0,i,t;for(this.property&&d.push(this);r=this.end},Ea.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},Ea.prototype.peek=function(){return this.string.charCodeAt(this.pos)},Ea.prototype.next=function(){if(this.pos'),Xi=function(o){var t=o.pos;if(or(o,Ja,Ka,!0)){var e=Fa(o,t);return e.type='comment',e}return null},Qi=rr(''),Ji=function(o){var t=o.pos;if(or(o,Qi,Yi,!0)){var e=Fa(o,t);return e.type='cdata',e}return null},$i={xml:!1,special:['script','style'],empty:['img','meta','link','br','base','hr','area','wbr']},Zi=function(o,t,e){this.dom=o,this.type=t,this.syntax=e};Zi.prototype.nodeForPoint=function(o,t){for(var e=this.dom.firstChild,n=null;e;)mn(cr(e),o,t)?(n=e,e=e.firstChild):e=e.nextSibling;return n};var es=function(o,r,e){null==e&&'string'==typeof o&&(e=o.length),this.string=o,this.pos=this.start=r||0,this.end=e};es.prototype.eof=function(){return this.pos>=this.end},es.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},es.prototype.peek=function(){return this.string.charCodeAt(this.pos)},es.prototype.next=function(){if(this.pos=gn(this.pos,this._sof)},t.prototype.eof=function(){return 0<=gn(this.pos,this._eof)},t.prototype.limit=function(n,o){return new this.constructor(this.editor,n,{from:n,to:o})},t.prototype.peek=function(){var o=this.pos,t=(o.line,o.ch),e=this.editor.getLine(this.pos.line);return t=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=Object.assign({},this._eof)),e}return NaN},t.prototype.backUp=function(a){var t=this,e=this.editor.constructor,n=this.pos,r=n.line,i=n.ch;for(i-=a||1;0<=r&&0>i;)r--,i+=t._lineLength(r);return this.pos=0>r||0>i?e.Pos(0,0):e.Pos(r,i),this.peek()},t.prototype.current=function(){return this.substring(this.start,this.pos)},t.prototype.substring=function(n,t){return this.editor.getRange(n,t)},t.prototype.error=function(n){var t=new Error(n+' at line '+this.pos.line+', column '+this.pos.ch);return t.originalMessage=n,t.pos=this.pos,t.string=this.string,t},t.prototype._lineLength=function(n){var t=n===this.editor.lastLine();return this.editor.getLine(n).length+(t?0:1)},t}(es),ns='emmet-open-tag',os='emmet-close-tag',rs={emmetExpandAbbreviation:function(a){if(a.somethingSelected())return a.constructor.Pass;var t=a.getCursor(),e=An(a,t),n=!1;if(e)n=xn(a,e.model.ast,e.find());else{var r=bn(a,t);if(r){var i={from:{line:t.line,ch:r.location},to:{line:t.line,ch:r.location+r.abbreviation.length}};n=xn(a,r.abbreviation,i)}}return Sn(a),n||a.constructor.Pass},emmetInsertLineBreak:function(d){var t=d.getCursor();if('xml'===d.getModeAt(t).name){var e=(Object.assign({},t,{ch:t.ch+1}),d.getTokenAt(t)),n=d.getTokenAt(Object.assign({},t,{ch:t.ch+1}));if('tag bracket'===e.type&&'>'===e.string&&'tag bracket'===n.type&&'t.alpha||0.5>=t.size))&&(1===A?n(t):2===A&&o(t))}function a(e,t){return t||(t=e,e=0),e+~~(Math.random()*(t-e+1))}function i(e,t){var n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout(function(){n=!1},t))}}function s(){h&&(O.clearRect(0,0,k,T),P=new Date().getTime(),!y&&(y=P),D=(P-y)/1e3,y=P,0=this.size-(this.bMin+p.snapOffset+this.bGutterSize)&&(e=this.size-(this.bMin+this.bGutterSize)),k.call(this,e),p.onDrag&&p.onDrag())},E=function(){var e=t.getComputedStyle(this.parent),n=this.parent[m]-parseFloat(e[b])-parseFloat(e[v]);this.size=this.a[s]()[u]+this.b[s]()[u]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(100*(this.size/n),100),this.start=this.a[s]()[f]},k=function(e){this.a.style[u]=a+'('+e/this.size*this.percentage+'% - '+this.aGutterSize+'px)',this.b.style[u]=a+'('+(this.percentage-e/this.size*this.percentage)+'% - '+this.bGutterSize+'px)'},T=function(){var e=this,t=e.a,n=e.b;t[s]()[u]n?n+1:16*n?e+6*((t-e)*n):1>2*n?t:2>3*n?e+6*((t-e)*(.66666-n)):e},c=function(t,n,o){var r,a;return a=.5>=o?o*(n+1):o+n-o*n,r=2*o-a,{r:f(r,a,t+.33333),g:f(r,a,t),b:f(r,a,t-.33333)}},x=function(t,n,o){var r,a,s,d,l,p,c;return d=C(t,n,o),l=S(t,n,o),r=d-l,c=d+l,a=l===d?0:t===d?(60*(n-o)/r+360)%360:n===d?60*(o-t)/r+120:60*(t-n)/r+240,s=c/2,p=0===s?0:1===s?1:.5>=s?r/c:r/(2-c),{h:a,s:p,l:s}},y=function(n,o,r,a){return null==a?'hsl('+m(t(180*n/s),360)+','+t(100*o)+'%,'+t(100*r)+'%)':'hsla('+m(t(180*n/s),360)+','+t(100*o)+'%,'+t(100*r)+'%,'+a+')'},u=function(t){var n,o,r,a,e,i;return i=document.createElement('span'),document.body.appendChild(i),i.style.backgroundColor=t,e=getComputedStyle(i).backgroundColor,document.body.removeChild(i),r=/^rgb\((\d+), (\d+), (\d+)\)$/.exec(e),r||(r=/^rgba\((\d+), (\d+), (\d+), ([\d.]+)\)$/.exec(e)),a=parseInt(r[1]),o=parseInt(r[2]),n=parseInt(r[3]),r[4]?{r:a/255,g:o/255,b:n/255,a:parseFloat(r[4])}:{r:a/255,g:o/255,b:n/255}},e=function(e){var t,n;return n=document.createElement('span'),document.body.appendChild(n),n.style.backgroundColor=e,t=0e&&(e+=t),e},v=function(e,t,n){return t+(n-t)*S(1,C(0,e))},p=function(){function e(f,E,b){var T,d,e,g,h,i,I,k,l,m,N,A,p,L,r,R,t,u,v,w,x;for(this.radius=f,this.width=E,this.lightness=b,L=this.radius,v=this.width,d=this.canvas=document.createElement('canvas'),d.width=d.height=2*L,e=d.getContext('2d'),N=e.createImageData(d.width,d.height),h=N.data,(x=m=0,r=d.height);0<=r?mr;x=0<=r?++m:--m)for(w=A=0,R=d.width;0<=R?AR;w=0<=R?++A:--A)I=x-L,i=w-L,g=o(I*I+i*i),g>L+1.5||(g-=10,u=C(0,S(1,g/(L-v/2-10))),l=n(I,i)/(2*s),t=c(l,u,this.lightness),p=t.r,k=t.g,T=t.b,h[4*(x*d.width+w)+0]=255*p,h[4*(x*d.width+w)+1]=255*k,h[4*(x*d.width+w)+2]=255*T,h[4*(x*d.width+w)+3]=255);e.putImageData(N,0,0)}return e.prototype.drawHSLCircle=function(t,n){var o,r,a,e;return t.width=t.height=2*this.radius,o=t.getContext('2d'),e=this.width,a=this.radius,r=v(n,e,a),o.save(),o.fillStyle='rgba(0,0,0,0.3)',o.beginPath(),o.arc(a,a,a,0,2*s),o.fill(),o.fillStyle='black',o.beginPath(),o.arc(a,a,r,0,2*s),o.arc(a,a,r-e,0,2*s,!0),o.fill(),o.globalCompositeOperation='source-in',o.drawImage(this.canvas,0,0),o.restore()},e}(),i=function(e){return'string'==typeof e&&(e=u(e)),null!=e.r&&null!=e.g&&null!=e.b?(e=x(e.r,e.g,e.b),e.h=e.h*s/180):null!=e.h&&null!=e.s&&null!=e.l&&(e.h=e.h*s/180),e},a=function(){function e(e){this.color=i(e),this.refColor=this.color,this.el=E(),this.circleContainer=this.el.appendChild(l.call(this)),this.lSlider=this.el.appendChild(b.call(this)),this.colorPreview=this.el.appendChild(f.call(this)),d.call(this),this.setLightness(this.color.l)}var d,l,f,h,b,E,T,w;return T=80,w=25,e.prototype.setHue=function(e){var n,o,r;return this.color.h=e,r=v(this.color.s,w,T)-w/2,o=T-w/2,g(this.hueKnob,{left:t(o+Math.cos(e)*r+6-1)+'px',top:t(o+Math.sin(e)*r+6-1)+'px'}),this.colorPreview.style.backgroundColor=this.lKnob.style.backgroundColor=this.hueKnob.style.backgroundColor=y(this.color.h,this.color.s,this.color.l),n=y(this.color.h,this.color.s,.5),this.lSlider.style.backgroundImage='-webkit-linear-gradient(bottom, black, '+n+' 50%, white)',this.lSlider.style.backgroundImage='-moz-linear-gradient(bottom, black, '+n+' 50%, white)',this.emit('changed')},e.prototype.setSaturation=function(e){return this.color.s=e,this.circle.drawHSLCircle(this.circleCanvas,e),this.setHue(this.color.h)},e.prototype.setLightness=function(e){return this.color.l=e,this.circle=new p(T,w,e),this.lKnob.style.top=(1-e)*this.lSlider._height-11+'px',this.setSaturation(this.color.s)},e.prototype.setHSL=function(e,t,n){return this.color.h=m(e,360)*s/180,this.color.s=C(0,S(1,t)),n=C(0,S(1,n)),this.setLightness(n)},e.prototype.getHSL=function(){return{h:m(180*this.color.h/s,360),s:this.color.s,l:this.color.l}},e.prototype.setRGB=function(t,n,o){var r,a,e,i;return e=x(t,n,o),r=e.h,i=e.s,a=e.l,this.setHSL(r,i,a)},e.prototype.getRGB=function(){return c(this.color.h/(2*s),this.color.s,this.color.l)},e.prototype.getCSS=function(){return y(this.color.h,this.color.s,this.color.l)},e.prototype.setCSS=function(t){var n,o,r,e;return e=u(t),r=e.r,o=e.g,n=e.b,this.setRGB(r,o,n)},e.prototype.on=function(e,t){var n;return null==this._listeners&&(this._listeners={}),(null==(n=this._listeners)[e]?n[e]=[]:n[e]).push(t)},e.prototype.emit=function(){var t,n,o,a,i,e,s,d;if(n=arguments[0],t=2<=arguments.length?r.call(arguments,1):[],this._listeners){for(s=null==(e=this._listeners[n])?[]:e,d=[],(o=0,i=s.length);o=7*s/8||p<=-7*s/8?t.style.cursor='ew-resize':s/8<=p&&p<3*s/8||-7*s/8HSL":'HEX24>RGB>HSL',"HEX32>HSLA":'HEX32>RGBA>HSLA',"HEX24>CMYK":'HEX24>RGB>CMY>CMYK',"RGB>CMYK":'RGB>CMY>CMYK'},i=Color.Space=function(t,n){s[n]&&(n=s[n]);var o=n.split('>');if('object'==typeof t&&0<=t[0]){for(var r=o[0],d={},l=0,p;l>0)+','+(e.G>>0)+','+(e.B>>0)+')'},i.RGBA_W3=function(e){var t='number'==typeof e.A?e.A/255:1;return'rgba('+(e.R>>0)+','+(e.G>>0)+','+(e.B>>0)+','+t+')'},i.W3_RGB=function(e){return e=e.substr(4,e.length-5).split(','),{R:parseInt(e[0],10),G:parseInt(e[1],10),B:parseInt(e[2],10)}},i.W3_RGBA=function(e){return e=e.substr(5,e.length-6).split(','),{R:parseInt(e[0],10),G:parseInt(e[1],10),B:parseInt(e[2],10),A:255*parseFloat(e[3])}},i.HSL_W3=function(e){return'hsl('+(e.H+.5>>0)+','+(e.S+.5>>0)+'%,'+(e.L+.5>>0)+'%)'},i.HSLA_W3=function(e){var t='number'==typeof e.A?e.A/255:1;return'hsla('+(e.H+.5>>0)+','+(e.S+.5>>0)+'%,'+(e.L+.5>>0)+'%,'+t+')'},i.W3_HSL=function(e){var t=e.indexOf('(')+1,n=e.indexOf(')');return e=e.substr(t,n-t).split(','),{H:parseInt(e[0],10),S:parseInt(e[1],10),L:parseInt(e[2],10)}},i.W3_HSLA=function(e){var t=e.indexOf('(')+1,n=e.indexOf(')');return e=e.substr(t,n-t).split(','),{H:parseInt(e[0],10),S:parseInt(e[1],10),L:parseInt(e[2],10),A:255*parseFloat(e[3],10)}},i.W3_HEX=i.W3_HEX24=function(e){return'#'===e.substr(0,1)&&(e=e.substr(1)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),parseInt('0x'+e,16)},i.W3_HEX32=function(e){return'#'===e.substr(0,1)&&(e=e.substr(1)),6===e.length?parseInt('0xFF'+e,10):parseInt('0x'+e,16)},i.HEX_W3=i.HEX24_W3=function(e,t){t||(t=6),e||(e=0);var n=e.toString(16),o;for(o=n.length;ot;)n=n.substr(1),o--;return'#'+n},i.HEX32_W3=function(e){return i.HEX_W3(e,8)},i.HEX_RGB=i.HEX24_RGB=function(e){return{R:e>>16,G:255&e>>8,B:255&e}},i.HEX32_RGBA=function(e){return{R:255&e>>>16,G:255&e>>>8,B:255&e,A:e>>>24}},i.RGBA_HEX32=function(e){return(e.A<<24|e.R<<16|e.G<<8|e.B)>>>0},i.RGB_HEX24=i.RGB_HEX=function(e){return 0>e.R&&(e.R=0),0>e.G&&(e.G=0),0>e.B&&(e.B=0),255c?p/(e+d):p/(2-e-d);var i=((e-o)/6+p/2)/p,g=((e-a)/6+p/2)/p,l=((e-s)/6+p/2)/p;o===e?u=l-g:a===e?u=1/3+i-l:s===e&&(u=2/3+g-i),0>u&&(u+=1),1c&&(c+=1),1r?r*(1+o):r+o-o*r,d=2*r-l,i=n+1/3,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d,i=n,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d,i=n-1/3,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d),{R:255*a,G:255*e,B:255*s,A:t.A}},i.HSVA_RGBA=i.HSV_RGB=function(n){var r=n.H/360,a=n.S/100,s=n.V/100,d,l,p,c,u,i;if(0==a)d=l=p=t(255*s);else switch(1<=r&&(r=0),r=6*r,c=r-o(r),u=t(255*s*(1-a)),p=t(255*s*(1-a*c)),i=t(255*s*(1-a*(1-c))),s=t(255*s),o(r)){case 0:d=s,l=i,p=u;break;case 1:d=p,l=s,p=u;break;case 2:d=u,l=s,p=i;break;case 3:d=u,l=p,p=s;break;case 4:d=i,l=u,p=s;break;case 5:d=s,l=u,p=p;}return{R:d,G:l,B:p,A:n.A}}}(),Inlet=function(){function e(b,C){function c(){var e=d.value+'',t=N.getCursor(!0),n=w(t,'number');if(n){var o={line:t.line,ch:n.start},r={line:t.line,ch:n.end};N.dragging=!0,N.replaceRange(e,o,r)}}function S(n){if(!N.somethingSelected()){I=n.target;var a=N.getCursor(!0),d=N.getTokenAt(a);cursorOffset=N.cursorCoords(!0,'page');var l=N.cursorCoords(!0,L).left,o=w(a,'number'),p=w(a,'hsl'),r=w(a,'hex'),s=w(a,'rgb'),t=w(a,'boolean'),c=cursorOffset.top-h;cursorOffset.topHSL>RGB>HEX24>W3'),P(picked,'hex')})}else if(p){var g=p.string;e=new thistle.Picker(g),e.setCSS(g),e.presentModal(m,c),e.on('changed',function(){picked=e.getCSS(),P(picked,'hsl')})}else if(s){var g=s.string;e=new thistle.Picker(g),e.setCSS(g),e.presentModal(m,c),e.on('changed',function(){picked=e.getCSS(),picked=Color.Space(picked,'W3>HSL>RGB>W3'),P(picked,'rgb')})}}}function T(e){var t,n;return t=0===e?[-100,100]:[3*-e,5*e],t[0]=d&&t.ch<=l)return e=null,{start:d,end:l,string:a};e=o.exec(r)}}}var N=b,d,e,A;C||(C={}),C.picker||(C.picker={}),C.slider||(C.slider={}),C.clicker||(C.clicker={});var g=C.container||document.body,h=C.picker.topOffset||220,i=C.picker.bottomOffset||16,f=C.picker.topBoundary||250,k=C.picker.leftOffset||75,l=C.slider.yOffset||15,m=C.slider.xOffset||0,n=C.slider.width,L=C.horizontalMode||'page',o=C.fixedContainer,p=C.slider.callback||function(){},r=C.picker.callback||function(){},s=C.clicker.callback||function(){},t=N.getWrapperElement();t.addEventListener('mouseup',S),document.body.addEventListener('mouseup',function(e){e.target===I||e.target===v||e.target===d||e.target===u||e.target===A||(v.style.visibility='hidden',u.style.visibility='hidden')}),N.setOption('onKeyEvent',function(){if(event=1==arguments.length?arguments[0]:arguments[1],event.keyCode==y||event.keyCode==O){if('visible'===v.style.visibility)return d.stepDown(1),c(),!0;event.altKey&&S()}else if(event.keyCode==E||event.keyCode==R){if('visible'===v.style.visibility)return d.stepUp(1),c(),!0;event.altKey&&S()}else v.style.visibility='hidden'});var u=document.createElement('div');u.className='inlet_clicker',u.style.visibility='hidden',u.style.position='absolute',g.appendChild(u);var A=document.createElement('input');A.className='checkbox',A.setAttribute('type','checkbox'),A.addEventListener('change',function(){var t=A.checked+'',n=N.getCursor(!0),o=w(n,'boolean');if(o){var e={line:n.line,ch:o.start},r={line:n.line,ch:o.end};N.replaceRange(t,e,r)}}),u.appendChild(A);var v=document.createElement('div');v.className='inlet_slider',v.style.visibility='hidden',n&&(v.style.width=n),v.style.position=o?'fixed':'absolute',v.style.top=0,g.appendChild(v);var d=document.createElement('input');d.className='range',d.setAttribute('type','range'),d.addEventListener('input',c),d.addEventListener('change',c);var x=-1=a.start&&(n.unshift(a.comment),this.leading.splice(r,1),this.trailing.splice(r,1));n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e,t){var n=[];if(0=t.end.offset&&n.unshift(r.comment);return this.trailing.length=0,n}var a=this.stack[this.stack.length-1];if(a&&a.node.trailingComments){var i=a.node.trailingComments[0];i&&i.range[0]>=t.end.offset&&(n=a.node.trailingComments,delete a.node.trailingComments)}return n},e.prototype.findLeadingComments=function(e,t){for(var n=[],o,r;0=t.start.offset);)o=this.stack.pop().node;if(o){for(var a=o.leadingComments?o.leadingComments.length:0,s=a-1,i;0<=s;--s)i=o.leadingComments[s],i.range[1]<=t.start.offset&&(n.unshift(i),o.leadingComments.splice(s,1));return o.leadingComments&&0===o.leadingComments.length&&delete o.leadingComments,n}for(var s=this.leading.length-1,r;0<=s;--s)r=this.leading[s],r.start<=t.start.offset&&(n.unshift(r.comment),this.leading.splice(s,1));return n},e.prototype.visitNode=function(e,t){if(!(e.type===o.Syntax.Program&&0":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.sourceType=t&&'module'===t.sourceType?'module':'script',this.lookahead=null,this.hasLineTerminator=!1,this.context={allowIn:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:'module'===this.sourceType},this.tokens=[],this.startMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.lastMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.nextToken(),this.lastMarker={index:this.scanner.index,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n>='===e||'>>>='===e||'&='===e||'^='===e||'|='===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=o,r},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=o||this.context.firstCoverInitializedNameError,r},e.prototype.consumeSemicolon=function(){this.match(';')?this.nextToken():!this.hasLineTerminator&&(this.lookahead.type!==i.Token.EOF&&!this.match('}')&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.lineNumber=this.startMarker.lineNumber,this.lastMarker.lineStart=this.startMarker.lineStart)},e.prototype.parsePrimaryExpression=function(){var e=this.createNode(),t,n,o,a;switch(this.lookahead.type){case i.Token.Identifier:'module'===this.sourceType&&'await'===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.finalize(e,new l.Identifier(this.nextToken().value));break;case i.Token.NumericLiteral:case i.Token.StringLiteral:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,r.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.BooleanLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),o.value='true'===o.value,a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.NullLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),o.value=null,a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.Template:t=this.parseTemplateLiteral();break;case i.Token.Punctuator:n=this.lookahead.value,'('===n?(this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression)):'['===n?t=this.inheritCoverGrammar(this.parseArrayInitializer):'{'===n?t=this.inheritCoverGrammar(this.parseObjectInitializer):'/'===n||'/='===n?(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,o=this.nextRegexToken(),a=this.getTokenRaw(o),t=this.finalize(e,new l.RegexLiteral(o.value,a,o.regex))):this.throwUnexpectedToken(this.nextToken());break;case i.Token.Keyword:!this.context.strict&&this.context.allowYield&&this.matchKeyword('yield')?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword('let')?t=this.finalize(e,new l.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword('function')?t=this.parseFunctionExpression():this.matchKeyword('this')?(this.nextToken(),t=this.finalize(e,new l.ThisExpression)):this.matchKeyword('class')?t=this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:this.throwUnexpectedToken(this.nextToken());}return t},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect('...');var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new l.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect('[');!this.match(']');)if(this.match(','))this.nextToken(),t.push(null);else if(this.match('...')){var n=this.parseSpreadElement();this.match(']')||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(',')),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match(']')||this.expect(',');return this.expect(']'),this.finalize(e,new l.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,n},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!1))},e.prototype.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),n=null;switch(t.type){case i.Token.StringLiteral:case i.Token.NumericLiteral:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,r.Messages.StrictOctalLiteral);var o=this.getTokenRaw(t);n=this.finalize(e,new l.Literal(t.value,o));break;case i.Token.Identifier:case i.Token.BooleanLiteral:case i.Token.NullLiteral:case i.Token.Keyword:n=this.finalize(e,new l.Identifier(t.value));break;case i.Token.Punctuator:'['===t.value?(n=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect(']')):this.throwUnexpectedToken(t);break;default:this.throwUnexpectedToken(t);}return n},e.prototype.isPropertyKey=function(e,t){return e.type===d.Syntax.Identifier&&e.name===t||e.type===d.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t=this.createNode(),n=this.lookahead,o=!1,a=!1,s=!1,d,p,c;n.type===i.Token.Identifier?(this.nextToken(),p=this.finalize(t,new l.Identifier(n.value))):this.match('*')?this.nextToken():(o=this.match('['),p=this.parseObjectPropertyKey());var u=this.qualifiedPropertyName(this.lookahead);if(n.type===i.Token.Identifier&&'get'===n.value&&u)d='get',o=this.match('['),p=this.parseObjectPropertyKey(),this.context.allowYield=!1,c=this.parseGetterMethod();else if(n.type===i.Token.Identifier&&'set'===n.value&&u)d='set',o=this.match('['),p=this.parseObjectPropertyKey(),c=this.parseSetterMethod();else if(n.type===i.Token.Punctuator&&'*'===n.value&&u)d='init',o=this.match('['),p=this.parseObjectPropertyKey(),c=this.parseGeneratorMethod(),a=!0;else if(p||this.throwUnexpectedToken(this.lookahead),d='init',this.match(':'))!o&&this.isPropertyKey(p,'__proto__')&&(e.value&&this.tolerateError(r.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),c=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match('('))c=this.parsePropertyMethodFunction(),a=!0;else if(n.type===i.Token.Identifier){var h=this.finalize(t,new l.Identifier(n.value));if(this.match('=')){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),s=!0;var m=this.isolateCoverGrammar(this.parseAssignmentExpression);c=this.finalize(t,new l.AssignmentPattern(h,m))}else s=!0,c=h}else this.throwUnexpectedToken(this.nextToken());return this.finalize(t,new l.Property(d,p,o,c,a,s))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect('{');for(var t=[],n={value:!1};!this.match('}');)t.push(this.parseObjectProperty(n)),this.match('}')||this.expectCommaSeparator();return this.expect('}'),this.finalize(e,new l.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){o.assert(this.lookahead.head,'Template literal must start with a template head');var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateElement=function(){this.lookahead.type!==i.Token.Template&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],o=this.parseTemplateHead();for(n.push(o);!o.tail;)t.push(this.parseExpression()),o=this.parseTemplateElement(),n.push(o);return this.finalize(e,new l.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case d.Syntax.Identifier:case d.Syntax.MemberExpression:case d.Syntax.RestElement:case d.Syntax.AssignmentPattern:break;case d.Syntax.SpreadElement:e.type=d.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case d.Syntax.ArrayExpression:e.type=d.Syntax.ArrayPattern;for(var t=0;t')||this.expect('=>'),e={type:p,params:[]};else{var t=this.lookahead,n=[];if(this.match('...'))e=this.parseRestElement(n),this.expect(')'),this.match('=>')||this.expect('=>'),e={type:p,params:[e]};else{var o=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(',')){var r=[];for(this.context.isAssignmentTarget=!1,r.push(e);this.startMarker.index')||this.expect('=>'),this.context.isBindingElement=!1;for(var a=0;a')&&(e.type===d.Syntax.Identifier&&'yield'===e.name&&(o=!0,e={type:p,params:[e]}),!o)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===d.Syntax.SequenceExpression)for(var a=0;a=o);){for(;2')){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var o=this.reinterpretAsCoverFormalsList(e);if(o){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var a=this.context.strict,i=this.context.allowYield;this.context.allowYield=!0;var s=this.startNode(t);this.expect('=>');var c=this.match('{')?this.parseFunctionSourceElements():this.isolateCoverGrammar(this.parseAssignmentExpression),u=c.type!==d.Syntax.BlockStatement;this.context.strict&&o.firstRestricted&&this.throwUnexpectedToken(o.firstRestricted,o.message),this.context.strict&&o.stricted&&this.tolerateUnexpectedToken(o.stricted,o.message),e=this.finalize(s,new l.ArrowFunctionExpression(o.params,c,u)),this.context.strict=a,this.context.allowYield=i}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(r.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===d.Syntax.Identifier){var h=e;this.scanner.isRestrictedWord(h.name)&&this.tolerateUnexpectedToken(n,r.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(h.name)&&this.tolerateUnexpectedToken(n,r.Messages.StrictReservedWord)}this.match('=')?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var m=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(n.value,e,m)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(',')){for(var n=[t];this.startMarker.index',t.TokenName[n.Identifier]='Identifier',t.TokenName[n.Keyword]='Keyword',t.TokenName[n.NullLiteral]='Null',t.TokenName[n.NumericLiteral]='Numeric',t.TokenName[n.Punctuator]='Punctuator',t.TokenName[n.StringLiteral]='String',t.TokenName[n.RegularExpression]='RegularExpression',t.TokenName[n.Template]='Template'},function(t,n,o){'use strict';function r(e){return'0123456789abcdef'.indexOf(e.toLowerCase())}function a(e){return'01234567'.indexOf(e)}var i=o(4),s=o(5),d=o(9),l=o(7),p=function(){function t(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=0=this.length},t.prototype.throwUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},t.prototype.tolerateUnexpectedToken=function(){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,s.Messages.UnexpectedTokenIllegal)},t.prototype.skipSingleLineComment=function(e){var t,n,o;for(this.trackComment&&(t=[],n=this.index-e,o={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(++this.index,d.Character.isLineTerminator(r)){if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[n+e,this.index-1],range:[n,this.index-1],loc:o};t.push(a)}return 13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart};var a={multiLine:!1,slice:[n+e,this.index],range:[n,this.index],loc:o};t.push(a)}return t},t.prototype.skipMultiLineComment=function(){var e,t,n;for(this.trackComment&&(e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var o=this.source.charCodeAt(this.index);if(d.Character.isLineTerminator(o))13===o&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===o){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:n};e.push(r)}return e}++this.index}else++this.index}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:n};e.push(r)}return this.tolerateUnexpectedToken(),e},t.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index,n;!this.eof();)if(n=this.source.charCodeAt(this.index),d.Character.isWhiteSpace(n))++this.index;else if(d.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n){if(n=this.source.charCodeAt(this.index+1),47===n){this.index+=2;var o=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(o)),t=!0}else if(42===n){this.index+=2;var o=this.skipMultiLineComment();this.trackComment&&(e=e.concat(o))}else break;}else if(t&&45===n){if(45===this.source.charCodeAt(this.index+1)&&62===this.source.charCodeAt(this.index+2)){this.index+=3;var o=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(o))}else break;}else if(60!==n)break;else if('!--'===this.source.slice(this.index+1,this.index+4)){this.index+=4;var o=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(o))}else break;return e},t.prototype.isFutureReservedWord=function(e){return'enum'===e||'export'===e||'import'===e||'super'===e},t.prototype.isStrictModeReservedWord=function(e){return'implements'===e||'interface'===e||'package'===e||'private'===e||'protected'===e||'public'===e||'static'===e||'yield'===e||'let'===e},t.prototype.isRestrictedWord=function(e){return'eval'===e||'arguments'===e},t.prototype.isKeyword=function(e){switch(e.length){case 2:return'if'===e||'in'===e||'do'===e;case 3:return'var'===e||'for'===e||'new'===e||'try'===e||'let'===e;case 4:return'this'===e||'else'===e||'case'===e||'void'===e||'with'===e||'enum'===e;case 5:return'while'===e||'break'===e||'catch'===e||'throw'===e||'const'===e||'yield'===e||'class'===e||'super'===e;case 6:return'return'===e||'typeof'===e||'delete'===e||'switch'===e||'export'===e||'import'===e;case 7:return'default'===e||'finally'===e||'extends'===e;case 8:return'function'===e||'continue'===e||'debugger'===e;case 10:return'instanceof'===e;default:return!1;}},t.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(55296<=t&&56319>=t){var n=this.source.charCodeAt(e+1);if(56320<=n&&57343>=n){var o=t;t=1024*(o-55296)+n-56320+65536}}return t},t.prototype.scanHexEscape=function(t){for(var n='u'===t?4:2,o=0,a=0;at)return this.index=e,this.getComplexIdentifier();if(d.Character.isIdentifierPart(t))++this.index;else break}return this.source.slice(e,this.index)},t.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=d.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,'{'===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape('u'),e=n.charCodeAt(0),(!n||'\\'===n||!d.Character.isIdentifierStart(e))&&this.throwUnexpectedToken()),t=n);!this.eof()&&(e=this.codePointAt(this.index),!!d.Character.isIdentifierPart(e));)n=d.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,'{'===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape('u'),e=n.charCodeAt(0),(!n||'\\'===n||!d.Character.isIdentifierPart(e))&&this.throwUnexpectedToken()),t+=n);return t},t.prototype.octalToDecimal=function(e){var t='0'!==e,n=a(e);return!this.eof()&&d.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+a(this.source[this.index++]),0<='0123'.indexOf(e)&&!this.eof()&&d.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:t}},t.prototype.scanIdentifier=function(){var e=this.index,t=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier(),n;return n=1===t.length?l.Token.Identifier:this.isKeyword(t)?l.Token.Keyword:'null'===t?l.Token.NullLiteral:'true'===t||'false'===t?l.Token.BooleanLiteral:l.Token.Identifier,{type:n,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var e={type:l.Token.Punctuator,value:'',lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index},t=this.source[this.index];return'('===t||'{'===t?('{'===t&&this.curlyStack.push('{'),++this.index):'.'===t?(++this.index,'.'===this.source[this.index]&&'.'===this.source[this.index+1]&&(this.index+=2,t='...')):'}'===t?(++this.index,this.curlyStack.pop()):')'===t||';'===t||','===t||'['===t||']'===t||':'===t||'?'===t||'~'===t?++this.index:(t=this.source.substr(this.index,4),'>>>='===t?this.index+=4:(t=t.substr(0,3),'==='===t||'!=='===t||'>>>'===t||'<<='===t||'>>='===t||'**='===t?this.index+=3:(t=t.substr(0,2),'&&'===t||'||'===t||'=='===t||'!='===t||'+='===t||'-='===t||'*='===t||'/='===t||'++'===t||'--'===t||'<<'===t||'>>'===t||'&='===t||'|='===t||'^='===t||'%='===t||'<='===t||'>='===t||'=>'===t||'**'===t?this.index+=2:(t=this.source[this.index],0<='<>=!+-*%&|^/'.indexOf(t)&&++this.index)))),this.index===e.start&&this.throwUnexpectedToken(),e.end=this.index,e.value=t,e},t.prototype.scanHexLiteral=function(e){for(var t='';!this.eof()&&!!d.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),d.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:l.Token.NumericLiteral,value:parseInt('0x'+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanBinaryLiteral=function(e){for(var t='',n;!this.eof()&&(n=this.source[this.index],'0'===n||'1'===n);)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),this.eof()||(n=this.source.charCodeAt(this.index),(d.Character.isIdentifierStart(n)||d.Character.isDecimalDigit(n))&&this.throwUnexpectedToken()),{type:l.Token.NumericLiteral,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanOctalLiteral=function(e,t){var n='',o=!1;for(d.Character.isOctalDigit(e.charCodeAt(0))?(o=!0,n='0'+this.source[this.index++]):++this.index;!this.eof()&&!!d.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return o||0!==n.length||this.throwUnexpectedToken(),(d.Character.isIdentifierStart(this.source.charCodeAt(this.index))||d.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:l.Token.NumericLiteral,value:parseInt(n,8),octal:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1,t;e=i?e(i):o}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o));try{RegExp(r)}catch(t){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,n)}catch(e){return null}},t.prototype.scanRegExpBody=function(){var e=this.source[this.index];i.assert('/'===e,'Regular expression literal must start with a slash');for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e=this.source[this.index++],t+=e,'\\'===e)e=this.source[this.index++],d.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(d.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)']'===e&&(n=!1);else if('/'===e){o=!0;break}else'['===e&&(n=!0);o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);var r=t.substr(1,t.length-2);return{value:r,literal:t}},t.prototype.scanRegExpFlags=function(){for(var e='',t='',n;!this.eof()&&(n=this.source[this.index],!!d.Character.isIdentifierPart(n.charCodeAt(0)));)if(++this.index,'\\'!==n||this.eof())t+=n,e+=n;else if(n=this.source[this.index],'u'===n){++this.index;var o=this.index;if(n=this.scanHexEscape('u'),n)for(t+=n,e+='\\u';oe&&d.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t)}();n.Scanner=p},function(t,n){'use strict';var o={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};n.Character={fromCodePoint:function(t){return 65536>t?e(t):e(55296+(t-65536>>10))+e(56320+(1023&t-65536))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||5760<=e&&0<=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||92===e||128<=e&&o.NonAsciiIdentifierStart.test(n.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||48<=e&&57>=e||92===e||128<=e&&o.NonAsciiIdentifierPart.test(n.Character.fromCodePoint(e))},isDecimalDigit:function(e){return 48<=e&&57>=e},isHexDigit:function(e){return 48<=e&&57>=e||65<=e&&70>=e||97<=e&&102>=e},isOctalDigit:function(e){return 48<=e&&55>=e}}},function(e,t,n){'use strict';var o=n(2),r=function(){return function(e){this.type=o.Syntax.ArrayExpression,this.elements=e}}();t.ArrayExpression=r;var a=function(){return function(e){this.type=o.Syntax.ArrayPattern,this.elements=e}}();t.ArrayPattern=a;var i=function(){return function(e,t,n){this.type=o.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n}}();t.ArrowFunctionExpression=i;var s=function(){return function(e,t,n){this.type=o.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}}();t.AssignmentExpression=s;var d=function(){return function(e,t){this.type=o.Syntax.AssignmentPattern,this.left=e,this.right=t}}();t.AssignmentPattern=d;var l=function(){return function(e,t,n){this.type='||'===e||'&&'===e?o.Syntax.LogicalExpression:o.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}}();t.BinaryExpression=l;var p=function(){return function(e){this.type=o.Syntax.BlockStatement,this.body=e}}();t.BlockStatement=p;var c=function(){return function(e){this.type=o.Syntax.BreakStatement,this.label=e}}();t.BreakStatement=c;var u=function(){return function(e,t){this.type=o.Syntax.CallExpression,this.callee=e,this.arguments=t}}();t.CallExpression=u;var h=function(){return function(e,t){this.type=o.Syntax.CatchClause,this.param=e,this.body=t}}();t.CatchClause=h;var m=function(){return function(e){this.type=o.Syntax.ClassBody,this.body=e}}();t.ClassBody=m;var g=function(){return function(e,t,n){this.type=o.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}}();t.ClassDeclaration=g;var f=function(){return function(e,t,n){this.type=o.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}}();t.ClassExpression=f;var y=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}}();t.ComputedMemberExpression=y;var b=function(){return function(e,t,n){this.type=o.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}}();t.ConditionalExpression=b;var v=function(){return function(e){this.type=o.Syntax.ContinueStatement,this.label=e}}();t.ContinueStatement=v;var x=function(){return function(){this.type=o.Syntax.DebuggerStatement}}();t.DebuggerStatement=x;var C=function(){return function(e,t){this.type=o.Syntax.ExpressionStatement,this.expression=e,this.directive=t}}();t.Directive=C;var S=function(){return function(e,t){this.type=o.Syntax.DoWhileStatement,this.body=e,this.test=t}}();t.DoWhileStatement=S;var E=function(){return function(){this.type=o.Syntax.EmptyStatement}}();t.EmptyStatement=E;var k=function(){return function(e){this.type=o.Syntax.ExportAllDeclaration,this.source=e}}();t.ExportAllDeclaration=k;var T=function(){return function(e){this.type=o.Syntax.ExportDefaultDeclaration,this.declaration=e}}();t.ExportDefaultDeclaration=T;var w=function(){return function(e,t,n){this.type=o.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}}();t.ExportNamedDeclaration=w;var I=function(){return function(e,t){this.type=o.Syntax.ExportSpecifier,this.exported=t,this.local=e}}();t.ExportSpecifier=I;var N=function(){return function(e){this.type=o.Syntax.ExpressionStatement,this.expression=e}}();t.ExpressionStatement=N;var A=function(){return function(e,t,n){this.type=o.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}}();t.ForInStatement=A;var L=function(){return function(e,t,n){this.type=o.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}}();t.ForOfStatement=L;var R=function(){return function(e,t,n,r){this.type=o.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r}}();t.ForStatement=R;var O=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1}}();t.FunctionDeclaration=O;var P=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1}}();t.FunctionExpression=P;var D=function(){return function(e){this.type=o.Syntax.Identifier,this.name=e}}();t.Identifier=D;var _=function(){return function(e,t,n){this.type=o.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}}();t.IfStatement=_;var M=function(){return function(e,t){this.type=o.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}}();t.ImportDeclaration=M;var F=function(){return function(e){this.type=o.Syntax.ImportDefaultSpecifier,this.local=e}}();t.ImportDefaultSpecifier=F;var B=function(){return function(e){this.type=o.Syntax.ImportNamespaceSpecifier,this.local=e}}();t.ImportNamespaceSpecifier=B;var U=function(){return function(e,t){this.type=o.Syntax.ImportSpecifier,this.local=e,this.imported=t}}();t.ImportSpecifier=U;var V=function(){return function(e,t){this.type=o.Syntax.LabeledStatement,this.label=e,this.body=t}}();t.LabeledStatement=V;var W=function(){return function(e,t){this.type=o.Syntax.Literal,this.value=e,this.raw=t}}();t.Literal=W;var H=function(){return function(e,t){this.type=o.Syntax.MetaProperty,this.meta=e,this.property=t}}();t.MetaProperty=H;var q=function(){return function(e,t,n,r,a){this.type=o.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=r,this.static=a}}();t.MethodDefinition=q;var j=function(){return function(e,t){this.type=o.Syntax.NewExpression,this.callee=e,this.arguments=t}}();t.NewExpression=j;var z=function(){return function(e){this.type=o.Syntax.ObjectExpression,this.properties=e}}();t.ObjectExpression=z;var K=function(){return function(e){this.type=o.Syntax.ObjectPattern,this.properties=e}}();t.ObjectPattern=K;var G=function(){return function(e,t){this.type=o.Syntax.Program,this.body=e,this.sourceType=t}}();t.Program=G;var X=function(){return function(e,t,n,r,a,i){this.type=o.Syntax.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=a,this.shorthand=i}}();t.Property=X;var Q=function(){return function(e,t,n){this.type=o.Syntax.Literal,this.value=e,this.raw=t,this.regex=n}}();t.RegexLiteral=Q;var Y=function(){return function(e){this.type=o.Syntax.RestElement,this.argument=e}}();t.RestElement=Y;var J=function(){return function(e){this.type=o.Syntax.ReturnStatement,this.argument=e}}();t.ReturnStatement=J;var $=function(){return function(e){this.type=o.Syntax.SequenceExpression,this.expressions=e}}();t.SequenceExpression=$;var Z=function(){return function(e){this.type=o.Syntax.SpreadElement,this.argument=e}}();t.SpreadElement=Z;var ee=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}}();t.StaticMemberExpression=ee;var te=function(){return function(){this.type=o.Syntax.Super}}();t.Super=te;var ne=function(){return function(e,t){this.type=o.Syntax.SwitchCase,this.test=e,this.consequent=t}}();t.SwitchCase=ne;var oe=function(){return function(e,t){this.type=o.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}}();t.SwitchStatement=oe;var re=function(){return function(e,t){this.type=o.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}}();t.TaggedTemplateExpression=re;var ae=function(){return function(e,t){this.type=o.Syntax.TemplateElement,this.value=e,this.tail=t}}();t.TemplateElement=ae;var ie=function(){return function(e,t){this.type=o.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}}();t.TemplateLiteral=ie;var se=function(){return function(){this.type=o.Syntax.ThisExpression}}();t.ThisExpression=se;var de=function(){return function(e){this.type=o.Syntax.ThrowStatement,this.argument=e}}();t.ThrowStatement=de;var le=function(){return function(e,t,n){this.type=o.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}}();t.TryStatement=le;var pe=function(){return function(e,t){this.type=o.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}}();t.UnaryExpression=pe;var ce=function(){return function(e,t,n){this.type=o.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}}();t.UpdateExpression=ce;var ue=function(){return function(e,t){this.type=o.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}}();t.VariableDeclaration=ue;var he=function(){return function(e,t){this.type=o.Syntax.VariableDeclarator,this.id=e,this.init=t}}();t.VariableDeclarator=he;var me=function(){return function(e,t){this.type=o.Syntax.WhileStatement,this.test=e,this.body=t}}();t.WhileStatement=me;var ge=function(){return function(e,t){this.type=o.Syntax.WithStatement,this.object=e,this.body=t}}();t.WithStatement=ge;var fe=function(){return function(e,t){this.type=o.Syntax.YieldExpression,this.argument=e,this.delegate=t}}();t.YieldExpression=fe},function(t,n,o){'use strict';function r(e){var t;switch(e.type){case p.JSXSyntax.JSXIdentifier:t=e.name;break;case p.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+':'+r(n.name);break;case p.JSXSyntax.JSXMemberExpression:var o=e;t=r(o.object)+'.'+r(o.property);}return t}var a=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=o(9),s=o(7),d=o(3),l=o(12),p=o(13),c=o(10),u=o(14),h;(function(e){e[e.Identifier=100]='Identifier',e[e.Text=101]='Text'})(h||(h={})),s.TokenName[h.Identifier]='JSXIdentifier',s.TokenName[h.Text]='JSXText';var m=function(t){function n(e,n,o){t.call(this,e,n,o)}return a(n,t),n.prototype.parsePrimaryExpression=function(){return this.match('<')?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},n.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.lineNumber,this.scanner.lineStart=this.startMarker.lineStart},n.prototype.finishJSX=function(){this.nextToken()},n.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.scanXHTMLEntity=function(){for(var t='&',n='',o;!this.scanner.eof();){if(o=this.scanner.source[this.scanner.index++],';'===o){if('#'===n[0]){n=n.substr(1);var r='x'===n[0],a=r?parseInt('0'+n,16):parseInt(n,10);t=e(a)}else l.XHTMLEntities[n]?t=l.XHTMLEntities[n]:t+=o;break}n+=o,t+=o}return t},n.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:s.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,o=this.scanner.source[this.scanner.index++],r='',a;!this.scanner.eof()&&(a=this.scanner.source[this.scanner.index++],a!==o);)r+='&'===a?this.scanXHTMLEntity():a;return{type:s.Token.StringLiteral,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var d=this.scanner.source.charCodeAt(this.scanner.index+1),l=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===d&&46===l?'...':'.',n=this.scanner.index;return this.scanner.index+=t.length,{type:s.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(i.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var a=this.scanner.source.charCodeAt(this.scanner.index);if(i.Character.isIdentifierPart(a)&&92!==a)++this.scanner.index;else if(45===a)++this.scanner.index;else break}var p=this.scanner.source.slice(n,this.scanner.index);return{type:h.Identifier,value:p,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}this.scanner.throwUnexpectedToken()},n.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},n.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;for(var e=this.scanner.index,t='',n;!this.scanner.eof()&&(n=this.scanner.source[this.scanner.index],'{'!==n&&'<'!==n);)++this.scanner.index,t+=n,i.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,'\r'===n&&'\n'===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index);this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart;var o={type:h.Text,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return 0');)t=this.matchJSX('{')?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute(),e.push(t);return e},n.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX('<');var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),o=this.matchJSX('/');return o&&this.expectJSX('/'),this.expectJSX('>'),this.finalize(e,new u.JSXOpeningElement(t,o,n))},n.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX('<'),this.matchJSX('/')){this.expectJSX('/');var t=this.parseJSXElementName();return this.expectJSX('>'),this.finalize(e,new u.JSXClosingElement(t))}var n=this.parseJSXElementName(),o=this.parseJSXAttributes(),r=this.matchJSX('/');return r&&this.expectJSX('/'),this.expectJSX('>'),this.finalize(e,new u.JSXOpeningElement(n,r,o))},n.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.finalize(e,new u.JSXEmptyExpression)},n.prototype.parseJSXExpression=function(){var e;return this.matchJSX('}')?e=this.parseJSXEmptyExpression():(this.finishJSX(),e=this.parseAssignmentExpression(),this.startJSX()),e},n.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX('{');var t=this.parseJSXExpression();return this.expectJSX('}'),this.finalize(e,new u.JSXExpressionContainer(t))},n.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start',nbsp:'\xA0',iexcl:'\xA1',cent:'\xA2',pound:'\xA3',curren:'\xA4',yen:'\xA5',brvbar:'\xA6',sect:'\xA7',uml:'\xA8',copy:'\xA9',ordf:'\xAA',laquo:'\xAB',not:'\xAC',shy:'\xAD',reg:'\xAE',macr:'\xAF',deg:'\xB0',plusmn:'\xB1',sup2:'\xB2',sup3:'\xB3',acute:'\xB4',micro:'\xB5',para:'\xB6',middot:'\xB7',cedil:'\xB8',sup1:'\xB9',ordm:'\xBA',raquo:'\xBB',frac14:'\xBC',frac12:'\xBD',frac34:'\xBE',iquest:'\xBF',Agrave:'\xC0',Aacute:'\xC1',Acirc:'\xC2',Atilde:'\xC3',Auml:'\xC4',Aring:'\xC5',AElig:'\xC6',Ccedil:'\xC7',Egrave:'\xC8',Eacute:'\xC9',Ecirc:'\xCA',Euml:'\xCB',Igrave:'\xCC',Iacute:'\xCD',Icirc:'\xCE',Iuml:'\xCF',ETH:'\xD0',Ntilde:'\xD1',Ograve:'\xD2',Oacute:'\xD3',Ocirc:'\xD4',Otilde:'\xD5',Ouml:'\xD6',times:'\xD7',Oslash:'\xD8',Ugrave:'\xD9',Uacute:'\xDA',Ucirc:'\xDB',Uuml:'\xDC',Yacute:'\xDD',THORN:'\xDE',szlig:'\xDF',agrave:'\xE0',aacute:'\xE1',acirc:'\xE2',atilde:'\xE3',auml:'\xE4',aring:'\xE5',aelig:'\xE6',ccedil:'\xE7',egrave:'\xE8',eacute:'\xE9',ecirc:'\xEA',euml:'\xEB',igrave:'\xEC',iacute:'\xED',icirc:'\xEE',iuml:'\xEF',eth:'\xF0',ntilde:'\xF1',ograve:'\xF2',oacute:'\xF3',ocirc:'\xF4',otilde:'\xF5',ouml:'\xF6',divide:'\xF7',oslash:'\xF8',ugrave:'\xF9',uacute:'\xFA',ucirc:'\xFB',uuml:'\xFC',yacute:'\xFD',thorn:'\xFE',yuml:'\xFF',OElig:'\u0152',oelig:'\u0153',Scaron:'\u0160',scaron:'\u0161',Yuml:'\u0178',fnof:'\u0192',circ:'\u02C6',tilde:'\u02DC',Alpha:'\u0391',Beta:'\u0392',Gamma:'\u0393',Delta:'\u0394',Epsilon:'\u0395',Zeta:'\u0396',Eta:'\u0397',Theta:'\u0398',Iota:'\u0399',Kappa:'\u039A',Lambda:'\u039B',Mu:'\u039C',Nu:'\u039D',Xi:'\u039E',Omicron:'\u039F',Pi:'\u03A0',Rho:'\u03A1',Sigma:'\u03A3',Tau:'\u03A4',Upsilon:'\u03A5',Phi:'\u03A6',Chi:'\u03A7',Psi:'\u03A8',Omega:'\u03A9',alpha:'\u03B1',beta:'\u03B2',gamma:'\u03B3',delta:'\u03B4',epsilon:'\u03B5',zeta:'\u03B6',eta:'\u03B7',theta:'\u03B8',iota:'\u03B9',kappa:'\u03BA',lambda:'\u03BB',mu:'\u03BC',nu:'\u03BD',xi:'\u03BE',omicron:'\u03BF',pi:'\u03C0',rho:'\u03C1',sigmaf:'\u03C2',sigma:'\u03C3',tau:'\u03C4',upsilon:'\u03C5',phi:'\u03C6',chi:'\u03C7',psi:'\u03C8',omega:'\u03C9',thetasym:'\u03D1',upsih:'\u03D2',piv:'\u03D6',ensp:'\u2002',emsp:'\u2003',thinsp:'\u2009',zwnj:'\u200C',zwj:'\u200D',lrm:'\u200E',rlm:'\u200F',ndash:'\u2013',mdash:'\u2014',lsquo:'\u2018',rsquo:'\u2019',sbquo:'\u201A',ldquo:'\u201C',rdquo:'\u201D',bdquo:'\u201E',dagger:'\u2020',Dagger:'\u2021',bull:'\u2022',hellip:'\u2026',permil:'\u2030',prime:'\u2032',Prime:'\u2033',lsaquo:'\u2039',rsaquo:'\u203A',oline:'\u203E',frasl:'\u2044',euro:'\u20AC',image:'\u2111',weierp:'\u2118',real:'\u211C',trade:'\u2122',alefsym:'\u2135',larr:'\u2190',uarr:'\u2191',rarr:'\u2192',darr:'\u2193',harr:'\u2194',crarr:'\u21B5',lArr:'\u21D0',uArr:'\u21D1',rArr:'\u21D2',dArr:'\u21D3',hArr:'\u21D4',forall:'\u2200',part:'\u2202',exist:'\u2203',empty:'\u2205',nabla:'\u2207',isin:'\u2208',notin:'\u2209',ni:'\u220B',prod:'\u220F',sum:'\u2211',minus:'\u2212',lowast:'\u2217',radic:'\u221A',prop:'\u221D',infin:'\u221E',ang:'\u2220',and:'\u2227',or:'\u2228',cap:'\u2229',cup:'\u222A',int:'\u222B',there4:'\u2234',sim:'\u223C',cong:'\u2245',asymp:'\u2248',ne:'\u2260',equiv:'\u2261',le:'\u2264',ge:'\u2265',sub:'\u2282',sup:'\u2283',nsub:'\u2284',sube:'\u2286',supe:'\u2287',oplus:'\u2295',otimes:'\u2297',perp:'\u22A5',sdot:'\u22C5',lceil:'\u2308',rceil:'\u2309',lfloor:'\u230A',rfloor:'\u230B',loz:'\u25CA',spades:'\u2660',clubs:'\u2663',hearts:'\u2665',diams:'\u2666',lang:'\u27E8',rang:'\u27E9'}},function(e,t){'use strict';t.JSXSyntax={JSXAttribute:'JSXAttribute',JSXClosingElement:'JSXClosingElement',JSXElement:'JSXElement',JSXEmptyExpression:'JSXEmptyExpression',JSXExpressionContainer:'JSXExpressionContainer',JSXIdentifier:'JSXIdentifier',JSXMemberExpression:'JSXMemberExpression',JSXNamespacedName:'JSXNamespacedName',JSXOpeningElement:'JSXOpeningElement',JSXSpreadAttribute:'JSXSpreadAttribute',JSXText:'JSXText'}},function(e,t,n){'use strict';var o=n(13),r=function(){return function(e){this.type=o.JSXSyntax.JSXClosingElement,this.name=e}}();t.JSXClosingElement=r;var a=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}}();t.JSXElement=a;var i=function(){return function(){this.type=o.JSXSyntax.JSXEmptyExpression}}();t.JSXEmptyExpression=i;var s=function(){return function(e){this.type=o.JSXSyntax.JSXExpressionContainer,this.expression=e}}();t.JSXExpressionContainer=s;var d=function(){return function(e){this.type=o.JSXSyntax.JSXIdentifier,this.name=e}}();t.JSXIdentifier=d;var l=function(){return function(e,t){this.type=o.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}}();t.JSXMemberExpression=l;var p=function(){return function(e,t){this.type=o.JSXSyntax.JSXAttribute,this.name=e,this.value=t}}();t.JSXAttribute=p;var c=function(){return function(e,t){this.type=o.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}}();t.JSXNamespacedName=c;var u=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}}();t.JSXOpeningElement=u;var h=function(){return function(e){this.type=o.JSXSyntax.JSXSpreadAttribute,this.argument=e}}();t.JSXSpreadAttribute=h;var m=function(){return function(e,t){this.type=o.JSXSyntax.JSXText,this.value=e,this.raw=t}}();t.JSXText=m},function(e,t,n){'use strict';var o=n(8),r=n(6),a=n(7),i=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return 0<=['(','{','[','in','typeof','instanceof','new','return','case','delete','throw','void','=','+=','-=','*=','**=','/=','%=','<<=','>>=','>>>=','&=','|=','^=',',','+','-','*','**','/','%','++','--','<<','>>','>>>','&','|','^','!','~','&&','||','?',':','===','==','>=','<=','<','>','!=','!=='].indexOf(e)},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case'this':case']':t=!1;break;case')':var n=this.values[this.paren-1];t='if'===n||'while'===n||'for'===n||'with'===n;break;case'}':if(t=!1,'function'===this.values[this.curly-3]){var o=this.values[this.curly-4];t=!!o&&!this.beforeFunctionExpression(o)}else if('function'===this.values[this.curly-4]){var r=this.values[this.curly-5];t=!r||!this.beforeFunctionExpression(r)}}return t},(e.prototype.push=function(e){e.type===a.Token.Punctuator||e.type===a.Token.Keyword?('{'===e.value?this.curly=this.values.length:'('===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e)}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&'boolean'==typeof t.tolerant&&t.tolerant,this.scanner=new o.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&'boolean'==typeof t.comment&&t.comment,this.trackRange=!!t&&'boolean'==typeof t.range&&t.range,this.trackLoc=!!t&&'boolean'==typeof t.loc&&t.loc,this.buffer=[],this.reader=new i}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var n=0;nn?e[t++]=n:2048>n?(e[t++]=192|n>>6,e[t++]=128|63&n):55296==(64512&n)&&r+1>18,e[t++]=128|63&n>>12,e[t++]=128|63&n>>6,e[t++]=128|63&n):(e[t++]=224|n>>12,e[t++]=128|63&n>>6,e[t++]=128|63&n);return e},n=function(l){for(var e=[],t=0,r=0,n;tn)e[r++]=d(n);else if(191n){var o=l[t++];e[r++]=d((31&n)<<6|63&o)}else if(239n){var o=l[t++],i=l[t++],a=l[t++],p=((7&n)<<18|(63&o)<<12|(63&i)<<6|63&a)-65536;e[r++]=d(55296+(p>>10)),e[r++]=d(56320+(1023&p))}else{var o=l[t++],i=l[t++];e[r++]=d((15&n)<<12|(63&o)<<6|63&i)}return e.join('')};a.base64={y:null,b:null,_:null,g:null,ENCODED_VALS_BASE:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',get ENCODED_VALS(){return this.ENCODED_VALS_BASE+'+/='},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+'-_.'},HAS_NATIVE_SUPPORT:'function'==typeof atob,encodeByteArray:function(d,e){if(!Array.isArray(d))throw Error('encodeByteArray takes an array as a parameter');this.O();for(var t=e?this._:this.y,r=[],n=0;n>6,l=63&s;c||(l=64,i||(u=64)),r.push(t[o>>2],t[(3&o)<<4|a>>4],t[u],t[l])}return r.join('')},encodeString:function(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(i(n),e)},decodeString:function(o,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(o):n(this.decodeStringToByteArray(o,e))},decodeStringToByteArray:function(d,e){this.O();for(var t=e?this.g:this.b,r=[],n=0;n>4),64!=s){if(r.push(240&a<<4|s>>2),64!=c){r.push(192&s<<6|c)}}}return r},O:function(){if(!this.y){this.y={},this.b={},this._={},this.g={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.b[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.g[this.ENCODED_VALS.charAt(t)]=t)}}},a.base64Encode=function(t){var e=i(t);return a.base64.encodeByteArray(e,!0)},a.base64Decode=function(t){try{return a.base64.decodeString(t,!0)}catch(t){console.error('base64Decode failed: ',t)}return null}},function(n,e){'use strict';Object.defineProperty(e,'__esModule',{value:!0}),e.jsonEval=function(t){return JSON.parse(t)},e.stringify=function(t){return JSON.stringify(t)}},function(n,a){'use strict';Object.defineProperty(a,'__esModule',{value:!0}),a.contains=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.safeGet=function(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]},a.forEach=function(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])},a.extend=function(n,e){return a.forEach(e,function(e,t){n[e]=t}),n},a.clone=function(t){return a.extend({},t)},a.isNonNullObject=function(t){return'object'==typeof t&&null!==t},a.isEmpty=function(n){for(var e in n)return!1;return!0},a.getCount=function(n){var e=0;for(var t in n)e++;return e},a.map=function(a,e,t){var r={};for(var n in a)r[n]=e.call(t,a[n],n,a);return r},a.findKey=function(o,e,t){for(var r in o)if(e.call(t,o[r],r,o))return r},a.findValue=function(t,e,r){var n=a.findKey(t,e,r);return n&&t[n]},a.getAnyKey=function(n){for(var e in n)return e},a.getValues=function(o){var e=[],t=0;for(var r in o)e[t++]=o[r];return e},a.every=function(n,e){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&!e(t,n[t]))return!1;return!0}},,,,,,,,,,,,,,,,,,,,,,,,,,function(n,e,t){t(58),n.exports=t(6).default},function(a,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var r=t(59),n=(t.n(r),t(63)),o=(t.n(n),t(64));t.n(o)},function(e,t,o){(function(e){var t=function(){if(void 0!==e)return e;if(void 0!==a)return a;if('undefined'!=typeof self)return self;throw Error('unable to locate global object')}();'undefined'==typeof Promise&&(t.Promise=Promise=o(60))}).call(t,o(12))},function(d,e,t){(function(p){!function(e){function m(){}function n(n,e){return function(){n.apply(e,arguments)}}function o(t){if('object'!=typeof this)throw new TypeError('Promises must be constructed via new');if('function'!=typeof t)throw new TypeError('not a function');this._state=0,this._handled=!1,this._value=void 0,this.T=[],g(t,this)}function i(i,s){for(;3===i._state;)i=i._value;return 0===i._state?void i.T.push(s):void(i._handled=!0,o.A(function(){var e=1===i._state?s.onFulfilled:s.onRejected;if(null===e)return void(1===i._state?a:c)(s.promise,i._value);var t;try{t=e(i._value)}catch(t){return void c(s.promise,t)}a(s.promise,t)}))}function a(a,e){try{if(e===a)throw new TypeError('A promise cannot be resolved with itself.');if(e&&('object'==typeof e||'function'==typeof e)){var i=e.then;if(e instanceof o)return a._state=3,a._value=e,void s(a);if('function'==typeof i)return void g(n(i,e),a)}a._state=1,a._value=e,s(a)}catch(e){c(a,e)}}function c(n,e){n._state=2,n._value=e,s(n)}function s(n){2===n._state&&0===n.T.length&&o.A(function(){n._handled||o.j(n._value)});for(var e=0,t=n.T.length;e>>0;if('function'!=typeof a)throw new TypeError('predicate must be a function');for(var r=arguments[1],n=0,o;n>>0;if('function'!=typeof a)throw new TypeError('predicate must be a function');for(var r=arguments[1],n=0,o;n':''+o}),n=this.serviceName+': '+n+' ('+t+').';var o=new s(t,n);for(var r in d)d.hasOwnProperty(r)&&'_'!==r.slice(-1)&&(o[r]=d[r]);return o},t}();e.ErrorFactory=a},function(a,s,e){'use strict';Object.defineProperty(s,'__esModule',{value:!0});var d=e(29),n=e(30);s.decode=function(o){var e={},s={},l={},p='';try{var u=o.split('.');e=n.jsonEval(d.base64Decode(u[0])||''),s=n.jsonEval(d.base64Decode(u[1])||''),p=u[2],l=s.d||{},delete s.d}catch(t){}return{header:e,claims:s,data:l,signature:p}},s.isValidTimestamp=function(t){var e=s.decode(t).claims,a=Math.floor(new Date().getTime()/1e3),i,r;return'object'==typeof e&&(e.hasOwnProperty('nbf')?i=e.nbf:e.hasOwnProperty('iat')&&(i=e.iat),r=e.hasOwnProperty('exp')?e.exp:i+86400),a&&i&&r&&a>=i&&a<=r},s.issuedAtTime=function(t){var e=s.decode(t).claims;return'object'==typeof e&&e.hasOwnProperty('iat')?e.iat:null},s.isValidFormat=function(t){var e=s.decode(t),o=e.claims;return!!e.signature&&!!o&&'object'==typeof o&&o.hasOwnProperty('iat')},s.isAdmin=function(t){var e=s.decode(t).claims;return'object'==typeof e&&!0===e.admin}},function(o,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var r=t(31);e.querystring=function(n){var o=[];return r.forEach(n,function(t,e){Array.isArray(e)?e.forEach(function(e){o.push(encodeURIComponent(t)+'='+encodeURIComponent(e))}):o.push(encodeURIComponent(t)+'='+encodeURIComponent(e))}),o.length?'&'+o.join('&'):''},e.querystringDecode=function(n){var o={};return n.replace(/^\?/,'').split('&').forEach(function(t){if(t){var e=t.split('=');o[e[0]]=e[1]}}),o}},function(a,e,t){'use strict';var r=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t])};return function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(e,'__esModule',{value:!0});var n=t(72),o=function(n){function e(){var e=n.call(this)||this;e.D=[],e.I=[],e.x=[],e.F=[],e.L=0,e.R=0,e.blockSize=64,e.F[0]=128;for(var o=1;or;r++)t[r]=d.charCodeAt(l)<<24|d.charCodeAt(l+1)<<16|d.charCodeAt(l+2)<<8|d.charCodeAt(l+3),l+=4;else for(var r=0;16>r;r++)t[r]=d[l]<<24|d[l+1]<<16|d[l+2]<<8|d[l+3],l+=4;for(var r=16,n;80>r;r++)n=t[r-3]^t[r-8]^t[r-14]^t[r-16],t[r]=4294967295&(n<<1|n>>>31);for(var o=this.D[0],p=this.D[1],s=this.D[2],c=this.D[3],u=this.D[4],r=0,h,i;80>r;r++){40>r?20>r?(h=c^p&(s^c),i=1518500249):(h=p^s^c,i=1859775393):60>r?(h=p&s|c&(p|s),i=2400959708):(h=p^s^c,i=3395469782);var n=4294967295&(o<<5|o>>>27)+h+u+i+t[r];u=c,c=s,s=4294967295&(p<<30|p>>>2),p=o,o=n}this.D[0]=4294967295&this.D[0]+o,this.D[1]=4294967295&this.D[1]+p,this.D[2]=4294967295&this.D[2]+s,this.D[3]=4294967295&this.D[3]+c,this.D[4]=4294967295&this.D[4]+u},e.prototype.update=function(a,s){if(null!=a){void 0===s&&(s=a.length);for(var t=s-this.blockSize,r=0,n=this.I,o=this.L;rthis.L?this.update(this.F,56-this.L):this.update(this.F,this.blockSize-(this.L-56));for(var t=this.blockSize-1;56<=t;t--)this.I[t]=255&e,e/=256;this.B(this.I);for(var r=0,t=0;5>t;t++)for(var n=24;0<=n;n-=8)a[r]=255&this.D[t]>>n,++r;return a},e}(n.Hash);e.Sha1=o},function(o,e){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var t=function(){return function(){this.blockSize=-1}}();e.Hash=t},function(n,e){'use strict';function s(a,i){if('object'!=typeof a||null===a)return!1;for(var t=0,r=i,n;t 4. Need to update it?');}var i=a+' failed: ';return i+=r+' argument '}function t(n,e,t,i){if((!i||t)&&'string'!=typeof t)throw Error(a(n,e,i)+'must be a valid firebase namespace.')}Object.defineProperty(e,'__esModule',{value:!0}),e.validateArgCount=function(a,e,t,r){var n;if(rt&&(n=0===t?'none':'no more than '+t),n){var o=a+' failed: Was called with '+r+(1===r?' argument.':' arguments.')+' Expects '+n+'.';throw Error(o)}},e.errorPrefix=a,e.validateNamespace=t,e.validateCallback=function(n,e,t,i){if((!i||t)&&'function'!=typeof t)throw Error(a(n,e,i)+'must be a valid function.')},e.validateContextObject=function(n,e,t,i){if((!i||t)&&('object'!=typeof t||null===t))throw Error(a(n,e,i)+'must be a valid context object.')}},function(o,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var r=t(28);e.stringToByteArray=function(n){for(var e=[],t=0,s=0,o;s=o){var i=o-55296;s++,r.assert(so?e[t++]=o:2048>o?(e[t++]=192|o>>6,e[t++]=128|63&o):65536>o?(e[t++]=224|o>>12,e[t++]=128|63&o>>6,e[t++]=128|63&o):(e[t++]=240|o>>18,e[t++]=128|63&o>>12,e[t++]=128|63&o>>6,e[t++]=128|63&o)}return e},e.stringLength=function(o){for(var e=0,t=0,r;tr?e++:2048>r?e+=2:55296<=r&&56319>=r?(e+=4,t++):e+=3;return e}}])}().default;try{webpackJsonpFirebase([4],{76:function(o,t,n){n(77)},77:function(o,t,Kn){var d=Math.max,ed=Math.floor;(function(e){(function(){function td(e){return'string'==typeof e}function e(e){return'boolean'==typeof e}function nd(){}function i(o){var r=typeof o;if('object'==r){if(!o)return'null';if(o instanceof Array)return'array';if(o instanceof Object)return r;var n=Object.prototype.toString.call(o);if('[object Window]'==n)return'object';if('[object Array]'==n||'number'==typeof o.length&&void 0!==o.splice&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable('splice'))return'array';if('[object Function]'==n||void 0!==o.call&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable('call'))return'function'}else if('function'==r&&void 0===o.call)return'object';return r}function r(e){return null===e}function od(e){return'array'==i(e)}function rd(e){var t=i(e);return'array'==t||'object'==t&&'number'==typeof e.length}function a(e){return'function'==i(e)}function ad(e){var o=typeof e;return'object'==o&&null!=e||'function'==o}function s(e){return e.call.apply(e.bind,arguments)}function h(o,r){if(!o)throw Error();if(2')&&(e=e.replace(Bd,'>')),-1!=e.indexOf('"')&&(e=e.replace(Ud,'"')),-1!=e.indexOf('\'')&&(e=e.replace(Vd,''')),-1!=e.indexOf('\0')&&(e=e.replace(Wd,'�')),e):e}function g(e,t){return-1!=e.indexOf(t)}function b(e,t){return et?1:0}function w(e,t){t.unshift(e),p.call(this,v.apply(null,t)),t.shift()}function y(e){throw new w('Failure'+(e?': '+e:''),Array.prototype.slice.call(arguments,1))}function I(t,n){var e=t.length,o=td(t)?t.split(''):t;for(--e;0<=e;--e)e in o&&n.call(void 0,o[e],e,t)}function T(t){t:{for(var n=Te,e=t.length,a=td(t)?t.split(''):t,r=0;rn?null:td(t)?t.charAt(n):t[n]}function A(e,t){return 0<=qd(e,t)}function k(o,t){t=qd(o,t);var n;return(n=0<=t)&&Array.prototype.splice.call(o,t,1),n}function E(o,t){var n=0;I(o,function(e,a){t.call(void 0,e,a,o)&&1==Array.prototype.splice.call(o,a,1).length&&n++})}function N(){return Array.prototype.concat.apply([],arguments)}function S(o){var t=o.length;if(0'),n=n.join('')}return n=t.createElement(n),o&&(td(o)?n.className=o:od(o)?n.className=o.join(' '):Dt(n,o)),2e.keyCode||void 0!=e.returnValue)){t:{var i=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(e){i=!0}(i||void 0==e.returnValue)&&(e.returnValue=!0)}for(e=[],i=t.b;i;i=i.parentNode)e.push(i);for(a=a.type,i=e.length-1;0<=i;i--){t.b=e[i];var r=on(e[i],a,!0,t);s=s&&r}for(i=0;i>4),64!=o&&(t(240&r<<4|o>>2),64!=a&&t(192&o<<6|a))}}function Pn(){if(!Yl){Yl={},Jl={};for(var e=0;65>e;e++)Yl[e]='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.charAt(e),Jl[Yl[e]]=e,62<=e&&(Jl['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.'.charAt(e)]=e)}}function Cn(e,t){this.g=[],this.v=e,this.o=t||null,this.f=this.a=!1,this.c=void 0,this.u=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function Rn(o,t,r){o.a=!0,o.c=r,o.f=!t,Un(o)}function _n(e){if(e.a){if(!e.u)throw new jn;e.u=!1}}function Dn(e,t){Ln(e,null,t,void 0)}function Ln(o,t,n,e){o.g.push([t,n,e]),o.a&&Un(o)}function xn(e){return Kd(e.g,function(e){return a(e[1])})}function Un(d){if(d.h&&d.a&&xn(d)){var t=d.h,n=$l[t];n&&(Ld.clearTimeout(n.a),delete $l[t]),d.h=0}d.b&&(d.b.l--,delete d.b),t=d.c;for(var e=n=!1;d.g.length&&!d.i;){var i=d.g.shift(),r=i[0],o=i[1];if(i=i[2],r=d.f?o:r)try{var a=r.call(i||d.o,t);void 0!==a&&(d.f=d.f&&(a==t||a instanceof Error),d.c=t=a),(K(t)||'function'==typeof Ld.Promise&&t instanceof Ld.Promise)&&(e=!0,d.i=!0)}catch(e){t=e,d.f=!0,xn(d)||(n=!0)}}d.c=t,e&&(a=f(d.m,d,!0),e=f(d.m,d,!1),t instanceof Cn?(Ln(t,a,e),t.w=!0):t.then(a,e)),n&&(t=new Vn(t),$l[t.a]=t,d.h=t.a)}function jn(){p.call(this)}function Mn(){p.call(this)}function Vn(e){this.a=Ld.setTimeout(f(this.c,this),0),this.b=e}function Fn(e,t){this.b=-1,this.b=ep,this.f=Ld.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=e,this.h=t,this.l=Ld.Int32Array?new Int32Array(64):Array(64),Zl||(Zl=Ld.Int32Array?new Int32Array(rp):rp),this.reset()}function qn(d){for(var t=d.f,n=d.l,e=0,i=0;it;t++){i=0|n[t-15],e=0|n[t-2];var r=0|(0|n[t-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3),o=0|(0|n[t-7])+((e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10);n[t]=0|r+o}e=0|d.a[0],i=0|d.a[1];var a=0|d.a[2],s=0|d.a[3],p=0|d.a[4],u=0|d.a[5],h=0|d.a[6];for(r=0|d.a[7],t=0;64>t;t++){var m=0|((e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10))+(e&i^e&a^i&a);o=p&u^~p&h,r=0|r+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7)),o=0|o+(0|Zl[t]),o=0|r+(0|o+(0|n[t])),r=h,h=u,u=p,p=0|s+o,s=a,a=i,i=e,e=0|o+m}d.a[0]=0|d.a[0]+e,d.a[1]=0|d.a[1]+i,d.a[2]=0|d.a[2]+a,d.a[3]=0|d.a[3]+s,d.a[4]=0|d.a[4]+p,d.a[5]=0|d.a[5]+u,d.a[6]=0|d.a[6]+h,d.a[7]=0|d.a[7]+r}function Xn(t,n,e){void 0===e&&(e=n.length);var i=0,r=t.c;if(td(n))for(;i=o&&o==(0|o)))throw Error('message must be a byte array');t.f[r++]=o,r==t.b&&(qn(t),r=0)}}t.c=r,t.g+=e}function Bn(){Fn.call(this,8,ap)}function Hn(t){if(t.P&&'function'==typeof t.P)return t.P();if(td(t))return t.split('');if(rd(t)){for(var n=[],e=t.length,o=0;ot)throw Error('Bad port number '+t);e.i=t}else e.i=null}function Zn(o,t,n){t instanceof ae?(o.a=t,pe(o.a,o.f)):(n||(t=re(t,pp)),o.a=new ae(t,0,o.f))}function Qn(o,t,n){o.a.set(t,n)}function te(e,t){return e.a.get(t)}function ne(e){return e instanceof Jn?new Jn(e):new Jn(e,void 0)}function ee(o,t){var n=new Jn(null,void 0);return Yn(n,'https'),o&&(n.b=o),t&&(n.g=t),n}function ie(e,t){return e?t?decodeURI(e.replace(/%25/g,'%2525')):decodeURIComponent(e):''}function re(t,n,e){return td(t)?(t=encodeURI(t).replace(n,oe),e&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,'%$1')),t):null}function oe(e){return e=e.charCodeAt(0),'%'+(15&e>>4).toString(16)+(15&e).toString(16)}function ae(o,t,n){this.b=this.a=null,this.c=o||null,this.f=!!n}function se(o){o.a||(o.a=new Tn,o.b=0,o.c&&zn(o.c,function(t,n){ce(o,decodeURIComponent(t.replace(/\+/g,' ')),n)}))}function ue(a){var t=Wn(a);if(void 0===t)throw Error('Keys are undefined');var n=new ae(null,0,void 0);a=Hn(a);for(var e=0;e2*e.c&&An(e)))}function fe(e,t){return se(e),t=de(e,t),kn(e.a.b,t)}function le(o,t,n){he(o,t),0n;n++){e=t[n];try{return new ActiveXObject(e),o.f=e}catch(e){}}throw Error('Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed')}return o.f}function we(e){hn.call(this),this.headers=new Tn,this.w=e||null,this.b=!1,this.v=this.a=null,this.g=this.I=this.i='',this.c=this.G=this.h=this.A=!1,this.f=0,this.m=null,this.l=hp,this.o=this.N=!1}function ye(a,t,n,e,i){if(a.a)throw Error('[goog.net.XhrIo] Object is active with another request='+a.i+'; newUri='+t);n=n?n.toUpperCase():'GET',a.i=t,a.g='',a.I=n,a.A=!1,a.b=!0,a.a=a.w?a.w.a():up.a(),a.v=me(a.w?a.w:up),a.a.onreadystatechange=f(a.Ab,a);try{En(a.J,Re(a,'Opening Xhr')),a.G=!0,a.a.open(n,t+'',!0),a.G=!1}catch(e){return En(a.J,Re(a,'Error opening Xhr: '+e.message)),void Ae(a,e)}t=e||'';var r=new Tn(a.headers);i&&Gn(i,function(e,t){r.set(t,e)}),i=T(r.S()),e=Ld.FormData&&t instanceof Ld.FormData,!A(yp,n)||i||e||r.set('Content-Type','application/x-www-form-urlencoded;charset=utf-8'),r.forEach(function(e,t){this.a.setRequestHeader(t,e)},a),a.l&&(a.a.responseType=a.l),'withCredentials'in a.a&&a.a.withCredentials!==a.N&&(a.a.withCredentials=a.N);try{Se(a),0e||$d&&ll&&!(9',s=Rt(s),o.document.write(Ct(s)),o.document.close())):o=s.open(Nt(t),d,o),o)try{o.focus()}catch(e){}return o}function ze(o){return new $(function(t){function n(){mn(2e3).then(function(){return o&&!o.closed?n():void t()})}return n()})}function Je(){var e=null;return new $(function(t){'complete'==Ld.document.readyState?t():(e=function(){t()},tn(window,'load',e))}).s(function(t){throw nn(window,'load',e),t})}function Ye(){return $e(void 0)?Je().then(function(){return new $(function(o,t){var n=Ld.document,e=setTimeout(function(){t(Error('Cordova framework is not ready.'))},1e3);n.addEventListener('deviceready',function(){clearTimeout(e),o()},!1)})}):nt(Error('Cordova must run in an Android or iOS file scheme.'))}function $e(e){return e=e||ii(),'file:'===ui()&&e.toLowerCase().match(/iphone|ipad|ipod|android/)}function Ze(){var e=Ld.window;try{return e&&e!=e.top}catch(e){return!1}}function Qe(){return Nd.INTERNAL.hasOwnProperty('reactNative')?'ReactNative':Nd.INTERNAL.hasOwnProperty('node')?'Node':'Browser'}function ti(){var e=Qe();return'ReactNative'===e||'Node'===e}function ni(e){var t=e.toLowerCase();return g(t,'opera/')||g(t,'opr/')||g(t,'opios/')?'Opera':g(t,'iemobile')?'IEMobile':g(t,'msie')||g(t,'trident/')?'IE':g(t,'edge/')?'Edge':g(t,'firefox/')?Sp:g(t,'silk/')?'Silk':g(t,'blackberry')?'Blackberry':g(t,'webos')?'Webos':!g(t,'safari/')||g(t,'chrome/')||g(t,'crios/')||g(t,'android')?(g(t,'chrome/')||g(t,'crios/'))&&!g(t,'edge/')?Ep:g(t,'android')?'Android':(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:'Other':'Safari'}function ei(o,t){t=t||[];var n=[],a={},r;for(r in kp)a[kp[r]]=!0;for(r=0;rt)throw Error('Short delay should be less than long delay!');this.c=o,this.b=t,o=n||ii(),e=e||Qe(),this.a=He(o)||'ReactNative'===e}function bi(){var e=Ld.document;return!e||void 0===e.visibilityState||'visible'==e.visibilityState}function wi(){var o=Ld.document,r=null;return bi()||!o?tt():new $(function(t){r=function(){bi()&&(o.removeEventListener('visibilitychange',r,!1),t())},o.addEventListener('visibilitychange',r,!1)}).s(function(t){throw o.removeEventListener('visibilitychange',r,!1),t})}function yi(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function Ii(o,t,n){wp?Object.defineProperty(o,t,{configurable:!0,enumerable:!0,value:n}):o[t]=n}function Ti(o,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Ii(o,n,t[n])}function Ai(e){var t={};return Ti(t,e),t}function ki(o){var t={},e;for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);return t}function Ei(o,r){if(!r||!r.length)return!0;if(!o)return!1;for(var a=0,e;a Auth section -> Sign in method tab.',o):'http'==n||'https'==n?r=v('This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.',o):t='operation-not-supported-in-this-environment',Oi.call(this,t,r)}function lr(o,t,n){Oi.call(this,o,n),o=t||{},o.sb&&Ii(this,'email',o.sb),o.Y&&Ii(this,'phoneNumber',o.Y),o.credential&&Ii(this,'credential',o.credential)}function dr(o){if(o.code){var t=o.code||'';0==t.indexOf(_p)&&(t=t.substring(_p.length));var n={credential:sr(o)};if(o.email)n.sb=o.email;else{if(!o.phoneNumber)return new Oi(t,o.message||void 0);n.Y=o.phoneNumber}return new lr(t,n,o.message)}return null}function pr(e){this.f=e}function vr(o,t,n){var e='Node'==Qe();if(!(e=Ld.XMLHttpRequest||e&&Nd.INTERNAL.node&&Nd.INTERNAL.node.XMLHttpRequest))throw new Oi('internal-error','The XMLHttpRequest compatibility library was not found.');this.b=o,o=t||{},this.i=o.secureTokenEndpoint||'https://securetoken.googleapis.com/v1/token',this.l=o.secureTokenTimeout||Jp,this.c=L(o.secureTokenHeaders||$p),this.g=o.firebaseEndpoint||'https://www.googleapis.com/identitytoolkit/v3/relyingparty/',this.h=o.firebaseTimeout||Zp,this.a=L(o.firebaseHeaders||ec),n&&(this.a['X-Client-Version']=n,this.c['X-Client-Version']=n),this.f=new je,this.o=new pr(e)}function mr(e,t){t?e.a['X-Firebase-Locale']=t:delete e.a['X-Firebase-Locale']}function gr(e,t){t?(e.a['X-Client-Version']=t,e.c['X-Client-Version']=t):(delete e.a['X-Client-Version'],delete e.c['X-Client-Version'])}function br(s,t,n,e,i,r,o){mi()?(Be()?s=f(s.m,s):(tc||(tc=new $(function(e,t){wr(e,t)})),s=f(s.u,s)),s(t,n,e,i,r,o)):n&&n(null)}function wr(e,t){((window.gapi||{}).client||{}).request?e():(Ld[oc]=function(){((window.gapi||{}).client||{}).request?e():t(Error('CORS_UNSUPPORTED'))},Dn(_e(At(nc,{onload:oc})),function(){t(Error('CORS_UNSUPPORTED'))}))}function yr(o,t){return new $(function(n,e){'refresh_token'==t.grant_type&&t.refresh_token||'authorization_code'==t.grant_type&&t.code?br(o,o.i+'?key='+encodeURIComponent(o.b),function(o){o?o.error?e(Mr(o)):o.access_token&&o.refresh_token?n(o):e(new Oi('internal-error')):e(new Oi('network-request-failed'))},'POST',''+ue(t),o.c,o.l.get()):e(new Oi('internal-error'))})}function Ir(d,t,l,e,i,n){var r=ne(d.g+t);Qn(r,'key',d.b),n&&Qn(r,'cb',''+Pd());var a='GET'==l;if(a)for(var o in e)e.hasOwnProperty(o)&&Qn(r,o,e[o]);return new $(function(s,n){br(d,''+r,function(e){e?e.error?n(Mr(e,i||{})):s(e):n(new Oi('network-request-failed'))},l,a?void 0:jt(fi(e)),d.a,d.h.get())})}function Tr(e){if(!bp.test(e.email))throw new Oi('invalid-email')}function Ar(e){'email'in e&&Tr(e)}function ud(e,t){return yd(e,dc,{identifier:t,continueUri:si()?Ke():'http://localhost'}).then(function(e){return e.allProviders||[]})}function Er(e){return yd(e,mc,{}).then(function(e){return e.authorizedDomains||[]})}function Nr(e){if(!e[Yp])throw new Oi('internal-error')}function hd(e){if(!(e.phoneNumber||e.temporaryProof)){if(!e.sessionInfo)throw new Oi('missing-verification-id');if(!e.code)throw new Oi('missing-verification-code')}else if(!e.phoneNumber||!e.temporaryProof)throw new Oi('internal-error')}function md(e,t){return yd(e,bc,t)}function Pr(o,t,r){return yd(o,pc,{idToken:t,deleteProvider:r})}function Cr(e){if(!e.requestUri||!e.sessionId&&!e.postBody)throw new Oi('internal-error')}function gd(e){var t=null;if(e.needConfirmation?(e.code='account-exists-with-different-credential',t=dr(e)):'FEDERATED_USER_ID_ALREADY_LINKED'==e.errorMessage?(e.code='credential-already-in-use',t=dr(e)):'EMAIL_EXISTS'==e.errorMessage?(e.code='email-already-in-use',t=dr(e)):e.errorMessage&&(t=jr(e.errorMessage)),t)throw t;if(!e[Yp])throw new Oi('internal-error')}function fd(e,t){return t.returnIdpCredential=!0,yd(e,Ec,t)}function Dr(e,t){return t.returnIdpCredential=!0,yd(e,Tc,t)}function Lr(e,t){return t.returnIdpCredential=!0,t.autoCreate=!1,yd(e,kc,t)}function xr(e){if(!e.oobCode)throw new Oi('invalid-action-code')}function yd(o,t,n){if(!Ei(n,t.ea))return nt(new Oi('internal-error'));var e=t.zb||'POST',r;return tt(n).then(t.D).then(function(){return t.T&&(n.returnSecureToken=!0),Ir(o,t.endpoint,e,n,t.Pb,t.nb||!1)}).then(function(e){return r=e}).then(t.O).then(function(){if(!t.ga)return r;if(!(t.ga in r))throw new Oi('internal-error');return r[t.ga]})}function jr(e){return Mr({error:{errors:[{message:e}],code:400,message:e}})}function Mr(o,t){var a=(o.error&&o.error.errors&&o.error.errors[0]||{}).reason||'',e={keyInvalid:'invalid-api-key',ipRefererBlocked:'app-not-authorized'};if(a=e[a]?new Oi(e[a]):null)return a;for(var i in a=o.error&&o.error.message||'',e={INVALID_CUSTOM_TOKEN:'invalid-custom-token',CREDENTIAL_MISMATCH:'custom-token-mismatch',MISSING_CUSTOM_TOKEN:'internal-error',INVALID_IDENTIFIER:'invalid-email',MISSING_CONTINUE_URI:'internal-error',INVALID_EMAIL:'invalid-email',INVALID_PASSWORD:'wrong-password',USER_DISABLED:'user-disabled',MISSING_PASSWORD:'internal-error',EMAIL_EXISTS:'email-already-in-use',PASSWORD_LOGIN_DISABLED:'operation-not-allowed',INVALID_IDP_RESPONSE:'invalid-credential',FEDERATED_USER_ID_ALREADY_LINKED:'credential-already-in-use',INVALID_MESSAGE_PAYLOAD:'invalid-message-payload',INVALID_RECIPIENT_EMAIL:'invalid-recipient-email',INVALID_SENDER:'invalid-sender',EMAIL_NOT_FOUND:'user-not-found',EXPIRED_OOB_CODE:'expired-action-code',INVALID_OOB_CODE:'invalid-action-code',MISSING_OOB_CODE:'internal-error',CREDENTIAL_TOO_OLD_LOGIN_AGAIN:'requires-recent-login',INVALID_ID_TOKEN:'invalid-user-token',TOKEN_EXPIRED:'user-token-expired',USER_NOT_FOUND:'user-token-expired',CORS_UNSUPPORTED:'cors-unsupported',DYNAMIC_LINK_NOT_ACTIVATED:'dynamic-link-not-activated',INVALID_APP_ID:'invalid-app-id',TOO_MANY_ATTEMPTS_TRY_LATER:'too-many-requests',WEAK_PASSWORD:'weak-password',OPERATION_NOT_ALLOWED:'operation-not-allowed',USER_CANCELLED:'user-cancelled',CAPTCHA_CHECK_FAILED:'captcha-check-failed',INVALID_APP_CREDENTIAL:'invalid-app-credential',INVALID_CODE:'invalid-verification-code',INVALID_PHONE_NUMBER:'invalid-phone-number',INVALID_SESSION_INFO:'invalid-verification-id',INVALID_TEMPORARY_PROOF:'invalid-credential',MISSING_APP_CREDENTIAL:'missing-app-credential',MISSING_CODE:'missing-verification-code',MISSING_PHONE_NUMBER:'missing-phone-number',MISSING_SESSION_INFO:'missing-verification-id',QUOTA_EXCEEDED:'quota-exceeded',SESSION_EXPIRED:'code-expired',INVALID_CONTINUE_URI:'invalid-continue-uri',MISSING_ANDROID_PACKAGE_NAME:'missing-android-pkg-name',MISSING_IOS_BUNDLE_ID:'missing-ios-bundle-id',UNAUTHORIZED_DOMAIN:'unauthorized-continue-uri',INVALID_OAUTH_CLIENT_ID:'invalid-oauth-client-id',INVALID_CERT_HASH:'invalid-cert-hash'},x(e,t||{}),t=(t=a.match(/^[^\s]+\s*:\s*(.*)$/))&&1t.c?Xn(t,op,56-t.c):Xn(t,op,t.b-(t.c-56));for(var e=63;56<=e;e--)t.f[e]=255&n,n/=256;for(qn(t),e=n=0;e>a;return Nn(o)}function jo(d,t,n,e){var i=xo(),r=new cr(t,e,null,i,new Oi('no-auth-event')),o=ri('BuildInfo.packageName',Ld);if('string'!=typeof o)throw new Oi('invalid-cordova-configuration');var l=ri('BuildInfo.displayName',Ld),s={};if(ii().toLowerCase().match(/iphone|ipad|ipod/))s.ibi=o;else{if(!ii().toLowerCase().match(/android/))return nt(new Oi('operation-not-supported-in-this-environment'));s.apn=o}l&&(s.appDisplayName=l),i=Uo(i),s.sessionId=i;var p=Zr(d.u,d.i,d.l,t,n,null,e,d.m,s,d.o);return d.ba().then(function(){var e=d.h;return d.A.a.set(jc,r.B(),e)}).then(function(){var t=ri('cordova.plugins.browsertab.isAvailable',Ld);if('function'!=typeof t)throw new Oi('invalid-cordova-configuration');var o=null;t(function(e){if(e){if('function'!=typeof(o=ri('cordova.plugins.browsertab.openUrl',Ld)))throw new Oi('invalid-cordova-configuration');o(p)}else{if('function'!=typeof(o=ri('cordova.InAppBrowser.open',Ld)))throw new Oi('invalid-cordova-configuration');e=ii(),e=e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i),d.a=o(p,e?'_blank':'_system','location=yes')}})})}function Mo(o,t){for(var n=0;ne.f&&(e.a=e.f),t)}function la(e,t){da(e),e.b=mn(fa(e,t)).then(function(){return e.l?tt():wi()}).then(function(){return e.h()}).then(function(){la(e,!0)}).s(function(t){e.i(t)&&la(e,!1)})}function da(e){e.b&&(e.b.cancel(),e.b=null)}function pa(e){this.f=e,this.b=this.a=null,this.c=0}function va(o,t){var n=t[Yp],e=t.refreshToken;t=ma(t.expiresIn),o.b=n,o.c=t,o.a=e}function ma(e){return Pd()+1e3*parseInt(e,10)}function ga(e,t){return yr(e.f,t).then(function(t){return e.b=t.access_token,e.c=ma(t.expires_in),e.a=t.refresh_token,{accessToken:e.b,expirationTime:e.c,refreshToken:e.a}}).s(function(t){throw'auth/user-token-expired'==t.code&&(e.a=null),t})}function ba(e,t){this.a=e||null,this.b=t||null,Ti(this,{lastSignInTime:yi(t||null),creationTime:yi(e||null)})}function wa(e){return new ba(e.a,e.b)}function ya(a,s,d,e,i,r){Ti(this,{uid:a,displayName:e||null,photoURL:i||null,email:d||null,phoneNumber:r||null,providerId:s})}function Ia(o,t){for(var n in Xt.call(this,o),t)this[n]=t[n]}function Ta(o,t,n){this.A=[],this.G=o.apiKey,this.o=o.appName,this.w=o.authDomain||null,o=Nd.SDK_VERSION?ei(Nd.SDK_VERSION):null,this.c=new vr(this.G,Vr(Oc),o),this.h=new pa(this.c),Ca(this,t[Yp]),va(this.h,t),Ii(this,'refreshToken',this.h.a),La(this,n||{}),hn.call(this),this.I=!1,this.w&&ai()&&(this.a=Zo(this.w,this.G,this.o)),this.N=[],this.i=null,this.l=Sa(this),this.U=f(this.Ga,this);var e=this;this.ha=null,this.ra=function(n){e.na(n.h)},this.W=null,this.R=[],this.qa=function(n){ka(e,n.f)},this.V=null}function Sd(e,t){e.W&&nn(e.W,'languageCodeChanged',e.ra),(e.W=t)&&$t(t,'languageCodeChanged',e.ra)}function ka(e,t){e.R=t,gr(e.c,Nd.SDK_VERSION?ei(Nd.SDK_VERSION,e.R):null)}function Ea(e,t){e.V&&nn(e.V,'frameworkChanged',e.qa),(e.V=t)&&$t(t,'frameworkChanged',e.qa)}function Na(e){try{return Nd.app(e.o).auth()}catch(t){throw new Oi('internal-error','No firebase.auth.Auth instance is available for the Firebase App \''+e.o+'\'!')}}function Sa(e){return new ha(function(){return e.F(!0)},function(e){return e&&'auth/network-request-failed'==e.code},function(){var t=e.h.c-Pd()-3e5;return 0i||i>=Jc.length)throw new Oi('internal-error','Argument validator received an unsupported number of arguments.');n=Jc[i],e=(e?'':n+' argument ')+(t.name?'"'+t.name+'" ':'')+'must be '+t.K+'.';break t}e=null}}if(e)throw new Oi('argument-error',s+' failed: '+e)}function Ds(o,n){return{name:o||'',K:'a valid string',optional:!!n,M:td}}function Ls(){return{name:'opt_forceRefresh',K:'a boolean',optional:!0,M:e}}function xs(e,t){return{name:e||'',K:'a valid object',optional:!!t,M:ad}}function Us(e,t){return{name:e||'',K:'a function',optional:!!t,M:a}}function js(e,t){return{name:e||'',K:'null',optional:!!t,M:r}}function Ms(){return{name:'',K:'an HTML element',optional:!1,M:function(e){return!!(e&&e instanceof Element)}}}function Vs(){return{name:'auth',K:'an instance of Firebase Auth',optional:!0,M:function(e){return!!(e&&e instanceof ps)}}}function Fs(){return{name:'app',K:'an instance of Firebase App',optional:!0,M:function(e){return!!(e&&e instanceof Nd.app.App)}}}function Ks(o){return{name:o?o+'Credential':'credential',K:o?'a valid '+o+' credential':'a valid credential',optional:!1,M:function(r){if(!r)return!1;var a=!o||r.providerId===o;return r.wa&&a}}}function qs(){return{name:'authProvider',K:'a valid Auth provider',optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty('isOAuthProvider'))}}}function Xs(){return{name:'applicationVerifier',K:'an implementation of firebase.auth.ApplicationVerifier',optional:!1,M:function(e){return!!(e&&td(e.type)&&a(e.verify))}}}function Bs(o,t,n,e){return{name:n||'',K:o.K+' or '+t.K,optional:!!e,M:function(n){return o.M(n)||t.M(n)}}}function Hs(d,t,n,e,i,r){if(Ii(this,'type','recaptcha'),this.b=this.c=null,this.m=!1,this.l=t,this.a=n||{theme:'light',type:'image'},this.g=[],this.a[eu])throw new Oi('argument-error','sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.');if(this.h='invisible'===this.a[tu],!_t(t)||!this.h&&_t(t).hasChildNodes())throw new Oi('argument-error','reCAPTCHA container is either not found or already contains inner elements!');this.u=new vr(d,r||null,i||null),this.o=e||function(){return null};var o=this;this.i=[];var a=this.a[$c];this.a[$c]=function(e){if(Ws(o,e),'function'==typeof a)a(e);else if('string'==typeof a){var t=ri(a,Ld);'function'==typeof t&&t(e)}};var l=this.a[Zc];this.a[Zc]=function(){if(Ws(o,null),'function'==typeof l)l();else if('string'==typeof l){var e=ri(l,Ld);'function'==typeof e&&e()}}}function Ws(o,t){for(var n=0;n>>0),Od=0,Pd=Date.now||function(){return+new Date},Dd;id(p,Error),p.prototype.name='CustomError';var _d=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,'')},Md=/&/g,Fd=//g,Ud=/"/g,Vd=/'/g,Wd=/\x00/g,Hd=/[\x00&<>"']/;id(w,p),w.prototype.name='AssertionError';var qd=Array.prototype.indexOf?function(o,t,n){return Array.prototype.indexOf.call(o,t,n)}:function(t,n,e){if(e=null==e?0:0>e?d(0,t.length+e):e,td(t))return td(n)&&1==n.length?t.indexOf(n,e):-1;for(;eparseFloat(rl)){ol=il+'';break t}}ol=rl}var sl={},dl=Ld.document,ll;ll=dl&&$d?M()||('CSS1Compat'==dl.compatMode?parseInt(ol,10):5):void 0,q.prototype.get=function(){if(0'),Rt(''),Rt('
');var Nl={cellpadding:'cellPadding',cellspacing:'cellSpacing',colspan:'colSpan',frameborder:'frameBorder',height:'height',maxlength:'maxLength',nonce:'nonce',role:'role',rowspan:'rowSpan',type:'type',usemap:'useMap',valign:'vAlign',width:'width'},Al={'"':'\\"',"\\":'\\\\',"/":'\\/',"":'\\b'," ":'\\f',"\n":'\\n',"\r":'\\r'," ":'\\t'," ":'\\u000b'},Ll=/\uffff/.test('\uFFFF')?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Rl=0,Ol={};Kt.prototype.oa=!1,Kt.prototype.ta=function(){if(this.Fa)for(;this.Fa.length;)this.Fa.shift()()};var Pl=Object.freeze||function(e){return e},Dl=!$d||9<=+ll,_l=$d&&!V('9'),Ml=function(){if(!Ld.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},'passive',{get:function(){e=!0}});return Ld.addEventListener('test',nd,t),Ld.removeEventListener('test',nd,t),e}();Xt.prototype.c=function(){this.Bb=!1},id(Bt,Xt);var Fl=Pl({2:'touch',3:'pen',4:'mouse'});Bt.prototype.c=function(){Bt.ib.c.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,_l)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},Bt.prototype.g=function(){return this.a};var Bl='closure_listenable_'+(0|1e6*Math.random()),Ul=0,Vl='closure_lm_'+(0|1e6*Math.random()),Wl={},Hl=0,ql='__closure_events_fn_'+(1e9*Math.random()>>>0);id(hn,Kt),hn.prototype[Bl]=!0,hn.prototype.removeEventListener=function(o,t,n,e){nn(this,o,t,n,e)},hn.prototype.ta=function(){if(hn.ib.ta.call(this),this.u){var o=this.u,n=0,e;for(e in o.a){for(var t=o.a[e],a=0;a=yn(this).value)for(a(t)&&(t=t()),o=new gn(o,t+'',this.f),n&&(o.a=n),n='log:'+o.b,(o=Ld.console)&&o.timeStamp&&o.timeStamp(n),(o=Ld.msWriteProfilerMark)&&o(n),n=this;n;)n=n.a};var Xl={},Ql=null;Dd=Tn.prototype,Dd.P=function(){An(this);for(var e=[],t=0;t=--t.l&&t.cancel()}this.v?this.v.call(this.o,this):this.u=!0,this.a||(e=new Mn,_n(this),Rn(this,!1,e))}},Cn.prototype.m=function(e,t){this.i=!1,Rn(this,e,t)},Cn.prototype.A=function(e){_n(this),Rn(this,!0,e)},Cn.prototype.then=function(a,t,n){var e=new $(function(e,t){o=e,i=t}),o,i;return Ln(this,o,function(n){n instanceof Mn?e.cancel():i(n)}),e.then(a,t,n)},F(Cn),id(jn,p),jn.prototype.message='Deferred has already fired',jn.prototype.name='AlreadyCalledError',id(Mn,p),Mn.prototype.message='Deferred was canceled',Mn.prototype.name='CanceledError',Vn.prototype.c=function(){throw delete $l[this.a],this.b};var $l={},Zl;id(Fn,function(){this.b=-1});for(var ep=64,tp=[],np=0;npthis.c-3e4?this.a?ga(this,{grant_type:'refresh_token',refresh_token:this.a}):tt(null):tt({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},ba.prototype.B=function(){return{lastLoginAt:this.b,createdAt:this.a}},id(Ia,Xt),id(Ta,hn),Ta.prototype.na=function(e){this.ha=e,mr(this.c,e)},Ta.prototype.$=function(){return this.ha},Ta.prototype.Ka=function(){return S(this.R)},Ta.prototype.Ga=function(){this.l.b&&(da(this.l),this.l.start())},Ii(Ta.prototype,'providerId','firebase'),Dd=Ta.prototype,Dd.reload=function(){var e=this;return Za(this,Ua(this).then(function(){return qa(e).then(function(){return _a(e)}).then(xa)}))},Dd.F=function(e){var o=this;return Za(this,Ua(this).then(function(){return o.h.getToken(e)}).then(function(e){if(!e)throw new Oi('internal-error');return e.accessToken!=o.pa&&(Ca(o,e.accessToken),fn(o,new Ia('tokenChanged'))),Fa(o,'refreshToken',e.refreshToken),e.accessToken}))},Dd.getToken=function(e){return Tp['firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.']||(Tp['firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.']=!0,'undefined'!=typeof console&&'function'==typeof console.warn&&console.warn('firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.')),this.F(e)},Dd.kc=function(o){if(!(o=o.users)||!o.length)throw new Oi('internal-error');o=o[0],La(this,{uid:o.localId,displayName:o.displayName,photoURL:o.photoUrl,email:o.email,emailVerified:!!o.emailVerified,phoneNumber:o.phoneNumber,lastLoginAt:o.lastLoginAt,createdAt:o.createdAt});for(var t=Ha(o),n=0;nthis.o&&(this.o=0),0==this.o&&Ss(this)&&Pa(Ss(this)),this.removeAuthTokenListener(o)},Dd.addAuthTokenListener=function(e){var t=this;this.m.push(e),Rs(this,this.i.then(function(){t.l||A(t.m,e)&&e(Os(t))}))},Dd.removeAuthTokenListener=function(e){E(this.m,function(t){return t==e})},Dd.delete=function(){this.l=!0;for(var e=0;et?n.push(o.substring(r,t)):n.push(o.substring(r,r+e));return n},m.each=function(o,a){if(Array.isArray(o))for(var e=0;er,r=Math.abs(r),2.2250738585072014e-308<=r?(o=Math.min(g(Math.log(r)/Math.LN2),1023),n=o+1023,i=t(r*Math.pow(2,52-o)-4503599627370496)):(n=0,i=t(r/5e-324))),s=[],a=52;a;a-=1)s.push(i%2?1:0),i=g(i/2);for(a=11;a;a-=1)s.push(n%2?1:0),n=g(n/2);s.push(e?1:0),s.reverse(),d=s.join('');var l='';for(a=0;64>a;a+=8){var p=parseInt(d.substr(a,8),2).toString(16);1===p.length&&(p='0'+p),l+=p}return l.toLowerCase()},m.isChromeExtensionContentScript=function(){return'object'==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)},m.isWindowsStoreApp=function(){return'object'==typeof Windows&&'object'==typeof Windows.UI},m.errorForServerCode=function(o,e){var t='Unknown Error';'too_big'===o?t='The data requested exceeds the maximum size that can be accessed with a single request.':'permission_denied'==o?t='Client doesn\'t have permission to access the desired data.':'unavailable'==o&&(t='The service is unavailable');var n=Error(o+' at '+e.path+': '+t);return n.code=o.toUpperCase(),n},m.e=/^-?\d{1,10}$/,m.tryParseInt=function(t){if(m.e.test(t)){var o=+t;if(-2147483648<=o&&2147483647>=o)return o}return null},m.exceptionGuard=function(t){try{t()}catch(t){setTimeout(function(){var e=t.stack||'';throw m.warn('Exception was thrown by user callback.',e),t},0)}},m.callUserCallback=function(t){for(var o=[],n=1;n=this.n.length?null:this.n[this.i]},o.prototype.getLength=function(){return this.n.length-this.i},o.prototype.popFront=function(){var e=this.i;return e=this.n.length)return null;for(var e=[],t=this.i;t=this.n.length},o.relativePath=function(e,t){var n=e.getFront(),r=t.getFront();if(null===n)return t;if(n===r)return o.relativePath(e.popFront(),t.popFront());throw Error('INTERNAL ERROR: innerPath ('+t+') is not within outerPath ('+e+')')},o.comparePaths=function(r,e){for(var t=r.slice(),n=e.slice(),i=0,o;io.getLength())return!1;for(;et.MAX_PATH_LENGTH_BYTES)throw Error(this.o+'has a key path longer than '+t.MAX_PATH_LENGTH_BYTES+' bytes ('+this.l+').');if(this.u.length>t.MAX_PATH_DEPTH)throw Error(this.o+'path specified exceeds the maximum depth that can be written ('+t.MAX_PATH_DEPTH+') or object contains a cycle '+this.toErrorString())},t.prototype.toErrorString=function(){return 0==this.u.length?'':'in property \''+this.u.join('.')+'\''},t}();e.ValidationPath=o},function(r,e,t){'use strict';var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(e,'__esModule',{value:!0});var o=t(15),d=t(1),i=t(5),l=t(16),c,a;e.setNodeFromJSON=function(t){c=t},e.setMaxNode=function(t){a=t};var s=function(o){function e(){return null!==o&&o.apply(this,arguments)||this}return n(e,o),e.prototype.compare=function(o,e){var t=o.node.getPriority(),n=e.node.getPriority(),r=t.compareTo(n);return 0===r?d.nameCompare(o.name,e.name):r},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(n,e){return!n.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return i.NamedNode.MIN},e.prototype.maxPost=function(){return new i.NamedNode(d.MAX_NAME,new l.LeafNode('[PRIORITY-POST]',a))},e.prototype.makePost=function(o,e){var t=c(o);return new i.NamedNode(e,new l.LeafNode('[PRIORITY-POST]',t))},e.prototype.toString=function(){return'.priority'},e}(o.Index);e.PriorityIndex=s,e.PRIORITY_INDEX=new s},function(m,g,e){'use strict';var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(g,'__esModule',{value:!0});var b=e(0),t=e(1),o=e(17),v=e(5),r=e(37),l=e(3),a=e(10),s=e(39),p=e(16),d=e(41),c=function(){function p(o,a,t){this._=o,this.y=a,this.g=t,this.m=null,this.y&&r.validatePriorityNode(this.y),this._.isEmpty()&&b.assert(!this.y||this.y.isEmpty(),'An empty node cannot have a priority')}return Object.defineProperty(p,'EMPTY_NODE',{get:function(){return u||(u=new p(new o.SortedMap(d.NAME_COMPARATOR),null,s.IndexMap.Default))},enumerable:!0,configurable:!0}),p.prototype.isLeafNode=function(){return!1},p.prototype.getPriority=function(){return this.y||u},p.prototype.updatePriority=function(e){return this._.isEmpty()?this:new p(this._,e,this.g)},p.prototype.getImmediateChild=function(n){if('.priority'===n)return this.getPriority();var e=this._.get(n);return null===e?u:e},p.prototype.getChild=function(n){var e=n.getFront();return null===e?this:this.getImmediateChild(e).getChild(n.popFront())},p.prototype.hasChild=function(t){return null!==this._.get(t)},p.prototype.updateImmediateChild=function(e,t){if(b.assert(t,'We should always be passing snapshot nodes'),'.priority'===e)return this.updatePriority(t);var n=new v.NamedNode(e,t),o,r,a;return t.isEmpty()?(o=this._.remove(e),r=this.g.removeFromIndexes(n,this._)):(o=this._.insert(e,t),r=this.g.addToIndexes(n,this._)),a=o.isEmpty()?u:this.y,new p(o,a,r)},p.prototype.updateChild=function(o,e){var t=o.getFront();if(null===t)return e;b.assert('.priority'!==o.getFront()||1===o.getLength(),'.priority must be the last token in a path');var n=this.getImmediateChild(t).updateChild(o.popFront(),e);return this.updateImmediateChild(t,n)},p.prototype.isEmpty=function(){return this._.isEmpty()},p.prototype.numChildren=function(){return this._.count()},p.prototype.val=function(e){if(this.isEmpty())return null;var d={},n=0,r=0,i=!0;if(this.forEachChild(l.PRIORITY_INDEX,function(t,o){d[t]=o.val(e),n++,i&&p.e.test(t)?r=Math.max(r,+t):i=!1}),!e&&i&&r<2*n){var o=[];for(var a in d)o[a]=d[a];return o}return e&&!this.getPriority().isEmpty()&&(d['.priority']=this.getPriority().val()),d},p.prototype.hash=function(){if(null===this.m){var o='';this.getPriority().isEmpty()||(o+='priority:'+r.priorityHashText(this.getPriority().val())+':'),this.forEachChild(l.PRIORITY_INDEX,function(e,t){var n=t.hash();''!==n&&(o+=':'+e+':'+n)}),this.m=''==o?'':t.sha1(o)}return this.m},p.prototype.getPredecessorChildName=function(o,e,t){var n=this.C(t);if(n){var r=n.getPredecessorKey(new v.NamedNode(o,e));return r?r.name:null}return this._.getPredecessorKey(o)},p.prototype.getFirstChildName=function(o){var e=this.C(o);if(e){var t=e.minKey();return t&&t.name}return this._.minKey()},p.prototype.getFirstChild=function(n){var e=this.getFirstChildName(n);return e?new v.NamedNode(e,this._.get(e)):null},p.prototype.getLastChildName=function(o){var e=this.C(o);if(e){var t=e.maxKey();return t&&t.name}return this._.maxKey()},p.prototype.getLastChild=function(n){var e=this.getLastChildName(n);return e?new v.NamedNode(e,this._.get(e)):null},p.prototype.forEachChild=function(o,r){var e=this.C(o);return e?e.inorderTraversal(function(t){return r(t.name,t.node)}):this._.inorderTraversal(r)},p.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},p.prototype.getIteratorFrom=function(o,e){var t=this.C(e);if(t)return t.getIteratorFrom(o,function(t){return t});for(var n=this._.getIteratorFrom(o.name,v.NamedNode.Wrap),r=n.peek();null!=r&&0>e.compare(r,o);)n.getNext(),r=n.peek();return n},p.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},p.prototype.getReverseIteratorFrom=function(o,e){var t=this.C(e);if(t)return t.getReverseIteratorFrom(o,function(t){return t});for(var n=this._.getReverseIteratorFrom(o.name,v.NamedNode.Wrap),r=n.peek();null!=r&&0p.S/3&&o.stringLength(e)>p.S)throw Error(i+'contains a string greater than '+p.S+' utf8 bytes '+a.toErrorString()+' (\''+e.substring(0,50)+'...\')');if(e&&'object'==typeof e){var s=!1,d=!1;if(c.forEach(e,function(e,t){if('.value'===e)s=!0;else if('.priority'!==e&&'.sv'!==e&&(d=!0,!p.isValidKey(e)))throw Error(i+' contains an invalid key ('+e+') '+a.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');a.push(e),p.validateFirebaseData(i,t,a),a.pop()}),s&&d)throw Error(i+' contains ".value" child '+a.toErrorString()+' in addition to actual children.')}},p.validateFirebaseMergePaths=function(r,e){var n,i;for(n=0;ni)a=this.I?a.left:a.right;else{if(0===i){this.O.push(a);break}this.O.push(a),a=this.I?a.right:a.left}}return t.prototype.getNext=function(){if(0===this.O.length)return null;var n=this.O.pop(),t;if(t=this.R?this.R(n.key,n.value):{key:n.key,value:n.value},this.I)for(n=n.left;!n.isEmpty();)this.O.push(n),n=n.right;else for(n=n.right;!n.isEmpty();)this.O.push(n),n=n.left;return t},t.prototype.hasNext=function(){return 0n?r.copy(null,null,null,r.left.insert(o,e,t),null):0===n?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(o,e,t)),r.D()},a.prototype.M=function(){if(this.left.isEmpty())return d.EMPTY_NODE;var t=this;return t.left.L()||t.left.left.L()||(t=t.F()),t=t.copy(null,null,null,t.left.M(),null),t.D()},a.prototype.remove=function(o,e){var t,n;if(t=this,0>e(o,t.key))t.left.isEmpty()||t.left.L()||t.left.left.L()||(t=t.F()),t=t.copy(null,null,null,t.left.remove(o,e),null);else{if(t.left.L()&&(t=t.x()),t.right.isEmpty()||t.right.L()||t.right.left.L()||(t=t.k()),0===e(o,t.key)){if(t.right.isEmpty())return d.EMPTY_NODE;n=t.right.A(),t=t.copy(n.key,n.value,null,null,t.right.M())}t=t.copy(null,null,null,null,t.right.remove(o,e))}return t.D()},a.prototype.L=function(){return this.color},a.prototype.D=function(){var t=this;return t.right.L()&&!t.left.L()&&(t=t.W()),t.left.L()&&t.left.left.L()&&(t=t.x()),t.left.L()&&t.right.L()&&(t=t.j()),t},a.prototype.F=function(){var t=this.j();return t.right.left.L()&&(t=t.copy(null,null,null,null,t.right.x()),t=t.W(),t=t.j()),t},a.prototype.k=function(){var t=this.j();return t.left.left.L()&&(t=t.x(),t=t.j()),t},a.prototype.W=function(){var e=this.copy(null,null,a.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},a.prototype.x=function(){var e=this.copy(null,null,a.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},a.prototype.j=function(){var n=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,e)},a.prototype.V=function(){var t=this.Q();return Math.pow(2,t)<=this.count()+1},a.prototype.Q=function(){var t;if(this.L()&&this.left.L())throw Error('Red node has red child('+this.key+','+this.value+')');if(this.right.L())throw Error('Right child of ('+this.key+','+this.value+') is red');if((t=this.left.Q())!==this.right.Q())throw Error('Black depths differ');return t+(this.L()?0:1)},a.RED=!0,a.BLACK=!1,a}();e.LLRBNode=r;var t=function(){function t(){}return t.prototype.copy=function(){return this},t.prototype.insert=function(n,e){return new r(n,e,null)},t.prototype.remove=function(){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(){return!1},t.prototype.reverseTraversal=function(){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.Q=function(){return 0},t.prototype.L=function(){return!1},t}();e.LLRBEmptyNode=t;var d=function(){function o(e,t){void 0===t&&(t=o.EMPTY_NODE),this.U=e,this.B=t}return o.prototype.insert=function(e,t){return new o(this.U,this.B.insert(e,t,this.U).copy(null,null,r.BLACK,null,null))},o.prototype.remove=function(e){return new o(this.U,this.B.remove(e,this.U).copy(null,null,r.BLACK,null,null))},o.prototype.get=function(o){for(var e=this.B,n;!e.isEmpty();){if(0===(n=this.U(o,e.key)))return e.value;0>n?e=e.left:0r?e=e.left:0.firebaseio.com instead'),n&&'undefined'!=n||o.fatal('Cannot parse Firebase url. Please use https://.firebaseio.com'),e.secure||o.warnIfPageIsSecure();var r='ws'===e.scheme||'wss'===e.scheme;return{repoInfo:new i.RepoInfo(e.host,e.secure,n,r),path:new t.Path(e.pathString)}},d.parseURL=function(r){var d='',m='',g='',f='',y=!0,b='https',v=443;if('string'==typeof r){var x=r.indexOf('//');0<=x&&(b=r.substring(0,x-1),r=r.substring(x+2));var l=r.indexOf('/');-1===l&&(l=r.length),d=r.substring(0,l),f=p(r.substring(l));var h=d.split('.');3===h.length?(m=h[1],g=h[0].toLowerCase()):2===h.length&&(m=h[0]),0<=(x=d.indexOf(':'))&&(y='https'===b||'wss'===b,v=parseInt(d.substring(x+1),10))}return{host:d,port:v,domain:m,subdomain:g,secure:y,scheme:b,pathString:f}}},function(d,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var l=t(0),r=t(0),p=t(13),i=t(14),n=function(){function t(o,a,t,n,r){void 0===r&&(r=''),this.secure=a,this.namespace=t,this.webSocketOnly=n,this.persistenceKey=r,this.host=o.toLowerCase(),this.domain=this.host.substr(this.host.indexOf('.')+1),this.internalHost=p.PersistentStorage.get('host:'+o)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost},t.prototype.isCacheableHost=function(){return's-'===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return'firebaseio-demo.com'===this.domain},t.prototype.isCustomHost=function(){return'firebaseio.com'!==this.domain&&'firebaseio-demo.com'!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&p.PersistentStorage.set('host:'+this.host,this.internalHost))},t.prototype.connectionURL=function(a,s){l.assert('string'==typeof a,'typeof type must == string'),l.assert('object'==typeof s,'typeof params must == object');var d;if(a===i.WEBSOCKET)d=(this.secure?'wss://':'ws://')+this.internalHost+'/.ws?';else{if(a!==i.LONG_POLLING)throw Error('Unknown connection type: '+a);d=(this.secure?'https://':'http://')+this.internalHost+'/.lp?'}this.needsQueryParam()&&(s.ns=this.namespace);var n=[];return r.forEach(s,function(o,e){n.push(o+'='+e)}),d+n.join('&')},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+='<'+this.persistenceKey+'>'),t},t.prototype.toURLString=function(){return(this.secure?'https://':'http://')+this.host},t}();e.RepoInfo=n},function(d,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var l=t(0),r=t(7),i=t(1),p=t(0),n=function(){function t(n,o){this.Ie=n,this.Oe=o}return t.prototype.cancel=function(n){l.validateArgCount('OnDisconnect.cancel',0,1,arguments.length),l.validateCallback('OnDisconnect.cancel',1,n,!0);var e=new p.Deferred;return this.Ie.onDisconnectCancel(this.Oe,e.wrapCallback(n)),e.promise},t.prototype.remove=function(n){l.validateArgCount('OnDisconnect.remove',0,1,arguments.length),r.validateWritablePath('OnDisconnect.remove',this.Oe),l.validateCallback('OnDisconnect.remove',1,n,!0);var e=new p.Deferred;return this.Ie.onDisconnectSet(this.Oe,null,e.wrapCallback(n)),e.promise},t.prototype.set=function(o,e){l.validateArgCount('OnDisconnect.set',1,2,arguments.length),r.validateWritablePath('OnDisconnect.set',this.Oe),r.validateFirebaseDataArg('OnDisconnect.set',1,o,this.Oe,!1),l.validateCallback('OnDisconnect.set',2,e,!0);var t=new p.Deferred;return this.Ie.onDisconnectSet(this.Oe,o,t.wrapCallback(e)),t.promise},t.prototype.setWithPriority=function(a,e,t){l.validateArgCount('OnDisconnect.setWithPriority',2,3,arguments.length),r.validateWritablePath('OnDisconnect.setWithPriority',this.Oe),r.validateFirebaseDataArg('OnDisconnect.setWithPriority',1,a,this.Oe,!1),r.validatePriority('OnDisconnect.setWithPriority',2,e,!1),l.validateCallback('OnDisconnect.setWithPriority',3,t,!0);var n=new p.Deferred;return this.Ie.onDisconnectSetWithPriority(this.Oe,a,e,n.wrapCallback(t)),n.promise},t.prototype.update=function(o,e){if(l.validateArgCount('OnDisconnect.update',1,2,arguments.length),r.validateWritablePath('OnDisconnect.update',this.Oe),Array.isArray(o)){for(var t={},n=0;n=e)throw Error('Query.limitToFirst: First argument must be a positive integer.');if(this.Ae.hasLimit())throw Error('Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).');return new h(this.repo,this.path,this.Ae.limitToFirst(e),this.De)},h.prototype.limitToLast=function(e){if(c.validateArgCount('Query.limitToLast',1,1,arguments.length),'number'!=typeof e||n(e)!==e||0>=e)throw Error('Query.limitToLast: First argument must be a positive integer.');if(this.Ae.hasLimit())throw Error('Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).');return new h(this.repo,this.path,this.Ae.limitToLast(e),this.De)},h.prototype.orderByChild=function(e){if(c.validateArgCount('Query.orderByChild',1,1,arguments.length),'$key'===e)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if('$priority'===e)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if('$value'===e)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');y.validatePathString('Query.orderByChild',1,e,!1),this.Fe('Query.orderByChild');var t=new l.Path(e);if(t.isEmpty())throw Error('Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.');var n=new s.PathIndex(t),o=this.Ae.orderBy(n);return h.Me(o),new h(this.repo,this.path,o,!0)},h.prototype.orderByKey=function(){c.validateArgCount('Query.orderByKey',0,0,arguments.length),this.Fe('Query.orderByKey');var e=this.Ae.orderBy(i.KEY_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.orderByPriority=function(){c.validateArgCount('Query.orderByPriority',0,0,arguments.length),this.Fe('Query.orderByPriority');var e=this.Ae.orderBy(o.PRIORITY_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.orderByValue=function(){c.validateArgCount('Query.orderByValue',0,0,arguments.length),this.Fe('Query.orderByValue');var e=this.Ae.orderBy(a.VALUE_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.startAt=function(e,t){void 0===e&&(e=null),c.validateArgCount('Query.startAt',0,2,arguments.length),y.validateFirebaseDataArg('Query.startAt',1,e,this.path,!0),y.validateKey('Query.startAt',2,t,!0);var n=this.Ae.startAt(e,t);if(h.Le(n),h.Me(n),this.Ae.hasStart())throw Error('Query.startAt: Starting point was already set (by another call to startAt or equalTo).');return void 0===e&&(e=null,t=null),new h(this.repo,this.path,n,this.De)},h.prototype.endAt=function(e,t){void 0===e&&(e=null),c.validateArgCount('Query.endAt',0,2,arguments.length),y.validateFirebaseDataArg('Query.endAt',1,e,this.path,!0),y.validateKey('Query.endAt',2,t,!0);var n=this.Ae.endAt(e,t);if(h.Le(n),h.Me(n),this.Ae.hasEnd())throw Error('Query.endAt: Ending point was already set (by another call to endAt or equalTo).');return new h(this.repo,this.path,n,this.De)},h.prototype.equalTo=function(n,e){if(c.validateArgCount('Query.equalTo',1,2,arguments.length),y.validateFirebaseDataArg('Query.equalTo',1,n,this.path,!1),y.validateKey('Query.equalTo',2,e,!0),this.Ae.hasStart())throw Error('Query.equalTo: Starting point was already set (by another call to startAt or equalTo).');if(this.Ae.hasEnd())throw Error('Query.equalTo: Ending point was already set (by another call to endAt or equalTo).');return this.startAt(n,e).endAt(n,e)},h.prototype.toString=function(){return c.validateArgCount('Query.toString',0,0,arguments.length),''+this.repo+this.path.toUrlEncodedString()},h.prototype.toJSON=function(){return c.validateArgCount('Query.toJSON',0,1,arguments.length),''+this},h.prototype.queryObject=function(){return this.Ae.getQueryObject()},h.prototype.queryIdentifier=function(){var n=this.queryObject(),e=u.ObjectToUniqueKey(n);return'{}'===e?'default':e},h.prototype.isEqual=function(e){if(c.validateArgCount('Query.isEqual',1,1,arguments.length),!(e instanceof h))throw Error('Query.isEqual failed: First argument must be an instance of firebase.database.Query.');var t=this.repo===e.repo,n=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return t&&n&&o},h.xe=function(o,e,a){var n={cancel:null,context:null};if(e&&a)n.cancel=e,c.validateCallback(o,3,n.cancel,!0),n.context=a,c.validateContextObject(o,4,n.context,!0);else if(e)if('object'==typeof e&&null!==e)n.context=e;else{if('function'!=typeof e)throw Error(c.errorPrefix(o,3,!0)+' must either be a cancel callback or a context object.');n.cancel=e}return n},Object.defineProperty(h.prototype,'ref',{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),h}(),f;e.Query=h},function(r,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var n=t(0),o=t(1),a=t(0),s;e.setMaxNode=function(t){s=t},e.priorityHashText=function(t){return'number'==typeof t?'number:'+o.doubleToIEEE754String(t):'string:'+t},e.validatePriorityNode=function(o){if(o.isLeafNode()){var e=o.val();n.assert('string'==typeof e||'number'==typeof e||'object'==typeof e&&a.contains(e,'.sv'),'Priority must be a string or number.')}else n.assert(o===s||o.isEmpty(),'priority of unexpected type.');n.assert(o===s||o.getPriority().isEmpty(),'Priority nodes can\'t have a priority of their own.')}},function(d,e,t){'use strict';var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(e,'__esModule',{value:!0});var r=t(15),i=t(5),o=t(1),a=t(11),s=function(r){function e(){return null!==r&&r.apply(this,arguments)||this}return n(e,r),e.prototype.compare=function(r,e){var t=r.node.compareTo(e.node);return 0===t?o.nameCompare(r.name,e.name):t},e.prototype.isDefinedOn=function(){return!0},e.prototype.indexedValueChanged=function(n,e){return!n.equals(e)},e.prototype.minPost=function(){return i.NamedNode.MIN},e.prototype.maxPost=function(){return i.NamedNode.MAX},e.prototype.makePost=function(o,e){var t=a.nodeFromJSON(o);return new i.NamedNode(e,t)},e.prototype.toString=function(){return'.value'},e}(r.Index);e.ValueIndex=s,e.VALUE_INDEX=new s},function(d,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var m=t(0),i=t(40),o=t(0),a=t(5),n=t(3),s=t(10),g={},l=function(){function l(n,o){this.ke=n,this.We=o}return Object.defineProperty(l,'Default',{get:function(){return m.assert(n.PRIORITY_INDEX,'ChildrenNode.ts has not been loaded'),p=p||new l({".priority":g},{".priority":n.PRIORITY_INDEX})},enumerable:!0,configurable:!0}),l.prototype.get=function(n){var e=o.safeGet(this.ke,n);if(!e)throw Error('No index defined for '+n);return e===g?null:e},l.prototype.hasIndex=function(t){return o.contains(this.We,''+t)},l.prototype.addIndex=function(e,t){m.assert(e!==s.KEY_INDEX,'KeyIndex always exists and isn\'t meant to be added to the IndexMap.');for(var n=[],r=!1,u=t.getIterator(a.NamedNode.Wrap),c=u.getNext();c;)r=r||e.isDefinedOn(c.node),n.push(c),c=u.getNext();var p=r?i.buildChildSet(n,e.getCompare()):g;var d=''+e,h=o.clone(this.We);h[d]=e;var f=o.clone(this.ke);return f[d]=p,new l(f,h)},l.prototype.addToIndexes=function(s,t){var n=this;return new l(o.map(this.ke,function(r,e){var u=o.safeGet(n.We,e);if(m.assert(u,'Missing index implementation for '+e),r===g){if(u.isDefinedOn(s.node)){for(var l=[],c=t.getIterator(a.NamedNode.Wrap),p=c.getNext();p;)p.name!=s.name&&l.push(p),p=c.getNext();return l.push(s),i.buildChildSet(l,u.getCompare())}return g}var d=t.get(s.name),h=r;return d&&(h=h.remove(new a.NamedNode(s.name,d))),h.insert(s,s.node)}),this.We)},l.prototype.removeFromIndexes=function(i,t){return new l(o.map(this.ke,function(n){if(n===g)return n;var e=t.get(i.name);return e?n.remove(new a.NamedNode(i.name,e)):n}),this.We)},l}(),p;e.IndexMap=l},function(o,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var d=t(17),r=t(17),i=function(){function t(n){this.count=function(t){return parseInt(Math.log(t)/0.6931471805599453,10)}(n+1),this.je=this.count-1;var o=function(t){return parseInt(Array(t+1).join('1'),2)}(this.count);this.Ve=n+1&o}return t.prototype.nextBitIsOne=function(){var t=!(this.Ve&1<=this.pn?(this.de('Secondary connection is healthy.'),this.nn=!0,this.tn.markConnectionHealthy(),this.dn()):(this.de('sending ping on secondary.'),this.tn.send({t:'c',d:{t:'p',d:{}}}))},t.prototype.dn=function(){this.tn.start(),this.de('sending client ack on secondary'),this.tn.send({t:'c',d:{t:'a',d:{}}}),this.de('Ending transmission on primary'),this.Yt.send({t:'c',d:{t:'n',d:{}}}),this.Zt=this.tn,this.tryCleanupConnection()},t.prototype.sn=function(o){var e=l.requireKey('t',o),t=l.requireKey('d',o);'c'==e?this.fn(t):'d'==e&&this.wt(t)},t.prototype.wt=function(t){this._n(),this.Ut(t)},t.prototype._n=function(){this.nn||0>=--this.zt&&(this.de('Primary connection is healthy.'),this.nn=!0,this.Yt.markConnectionHealthy())},t.prototype.fn=function(o){var e=l.requireKey('t',o);if('d'in o){var t=o.d;if('h'===e)this.yn(t);else if('n'===e){this.de('recvd end transmission on primary'),this.en=this.tn;for(var n=0;ndocument.domain="'+document.domain+'";');var d=''+s+'';try{this.myIFrame.doc.open(),this.myIFrame.doc.write(d),this.myIFrame.doc.close()}catch(t){m.log('frame writing exception'),t.stack&&m.log(t.stack),m.log(t)}}}return a.Dn=function(){var n=document.createElement('iframe');if(n.style.display='none',!document.body)throw'Document body has not initialized. Wait to initialize Firebase until after the document is ready.';document.body.appendChild(n);try{n.contentWindow.document||m.log('No IE domain setting required')}catch(t){var e=document.domain;n.src='javascript:void((function(){document.open();document.domain=\''+e+'\';document.close();})())'}return n.contentDocument?n.doc=n.contentDocument:n.contentWindow?n.doc=n.contentWindow.document:n.document&&(n.doc=n.document),n},a.prototype.close=function(){var e=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML='',setTimeout(function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},0)),f.isNodeSdk()&&this.myID){var t={};t[p.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM]='t',t[p.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,t[p.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW;var n=this.urlFn(t);a.nodeRestRequest(n)}var r=this.onDisconnect;r&&(this.onDisconnect=null,r())},a.prototype.startLongPoll=function(n,e){for(this.myID=n,this.myPW=e,this.alive=!0;this.Mn(););},a.prototype.Mn=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(0=this.pendingSegs[0].d.length+30+n.length;)a=this.pendingSegs.shift(),n=n+'&'+p.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM+r+'='+a.seg+'&'+p.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET+r+'='+a.ts+'&'+p.FIREBASE_LONGPOLL_DATA_PARAM+r+'='+a.d,r++;return e+=n,this.Ln(e,this.currentSerial),!0}return!1},a.prototype.enqueueSegment=function(o,r,a){this.pendingSegs.push({seg:o,ts:r,d:a}),this.alive&&this.Mn()},a.prototype.Ln=function(o,e){var t=this;this.outstandingRequests.add(e,1);var n=function(){t.outstandingRequests.remove(e),t.Mn()},r=setTimeout(n,25000);this.addTag(o,function(){clearTimeout(r),n()})},a.prototype.addTag=function(o,r){var e=this;f.isNodeSdk()?this.doNodeLongPoll(o,r):setTimeout(function(){try{if(!e.sendNewPolls)return;var t=e.myIFrame.doc.createElement('script');t.type='text/javascript',t.async=!0,t.src=o,t.onload=t.onreadystatechange=function(){var n=t.readyState;n&&'loaded'!==n&&'complete'!==n||(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),r())},t.onerror=function(){m.log('Long-poll script failed to load: '+o),e.sendNewPolls=!1,e.close()},e.myIFrame.doc.body.appendChild(t)}catch(t){}},1)},a}();p.FirebaseIFrameScriptHolder=l},function(o,r,t){'use strict';(function(n){Object.defineProperty(r,'__esModule',{value:!0});var e=t(6),i=t(0),o=t(1),a=t(25),m=t(14),u=t(0),l=t(13),s=t(0),h=t(0),p=null;'undefined'==typeof MozWebSocket?'undefined'!=typeof WebSocket&&(p=WebSocket):p=MozWebSocket,r.setWebSocketImpl=function(t){p=t};var d=function(){function d(t,e,n,r){this.connId=t,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.de=o.logWrapper(this.connId),this.$=a.StatsManager.getCollection(e),this.connURL=d.Fn(e,n,r)}return d.Fn=function(o,e,t){var n={};return n[m.VERSION_PARAM]=m.PROTOCOL_VERSION,!h.isNodeSdk()&&'undefined'!=typeof location&&location.href&&-1!==location.href.indexOf(m.FORGE_DOMAIN)&&(n[m.REFERER_PARAM]=m.FORGE_REF),e&&(n[m.TRANSPORT_SESSION_PARAM]=e),t&&(n[m.LAST_SESSION_PARAM]=t),o.connectionURL(m.WEBSOCKET,n)},d.prototype.open=function(i,t){var d=this;this.onDisconnect=t,this.onMessage=i,this.de('Websocket connecting to '+this.connURL),this.bn=!1,l.PersistentStorage.set('previous_websocket_failure',!0);try{if(h.isNodeSdk()){var r=u.CONSTANTS.NODE_ADMIN?'AdminNode':'Node',o={headers:{"User-Agent":'Firebase/'+m.PROTOCOL_VERSION+'/'+e.default.SDK_VERSION+'/'+n.platform+'/'+r}},a=n.env,s=0==this.connURL.indexOf('wss://')?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;s&&(o.proxy={origin:s}),this.mySock=new p(this.connURL,[],o)}else this.mySock=new p(this.connURL)}catch(t){this.de('Error instantiating WebSocket.');var g=t.message||t.data;return g&&this.de(g),void this.wn()}this.mySock.onopen=function(){d.de('Websocket connected.'),d.bn=!0},this.mySock.onclose=function(){d.de('Websocket connection was disconnected.'),d.mySock=null,d.wn()},this.mySock.onmessage=function(t){d.handleIncomingFrame(t)},this.mySock.onerror=function(n){d.de('WebSocket error. Closing connection.');var e=n.message||n.data;e&&d.de(e),d.wn()}},d.prototype.start=function(){},d.forceDisallow=function(){d.On=!0},d.isAvailable=function(){var t=!1;if('undefined'!=typeof navigator&&navigator.userAgent){var o=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(o);n&&1parseFloat(n[1])&&(t=!0)}return!t&&null!==p&&!d.On},d.previouslyFailed=function(){return l.PersistentStorage.isInMemoryStorage||!0===l.PersistentStorage.get('previous_websocket_failure')},d.prototype.markConnectionHealthy=function(){l.PersistentStorage.remove('previous_websocket_failure')},d.prototype.xn=function(o){if(this.frames.push(o),this.frames.length==this.totalFrames){var e=this.frames.join('');this.frames=null;var t=s.jsonEval(e);this.onMessage(t)}},d.prototype.kn=function(t){this.totalFrames=t,this.frames=[]},d.prototype.Wn=function(n){if(i.assert(null===this.frames,'We already have a frame buffer'),6>=n.length){var o=+n;if(!isNaN(o))return this.kn(o),null}return this.kn(1),n},d.prototype.handleIncomingFrame=function(o){if(null!==this.mySock){var e=o.data;if(this.bytesReceived+=e.length,this.$.incrementCounter('bytes_received',e.length),this.resetKeepAlive(),null!==this.frames)this.xn(e);else{var t=this.Wn(e);null!==t&&this.xn(t)}}},d.prototype.send=function(a){this.resetKeepAlive();var e=s.stringify(a);this.bytesSent+=e.length,this.$.incrementCounter('bytes_sent',e.length);var t=o.splitStringBySize(e,16384);1=this.me.compare(this.getStartPost(),t)&&0>=this.me.compare(t,this.getEndPost())},r.prototype.updateChild=function(a,e,t,n,r,i){return this.matches(new p.NamedNode(e,t))||(t=o.ChildrenNode.EMPTY_NODE),this.Vn.updateChild(a,e,t,n,r,i)},r.prototype.updateFullNode=function(a,e,t){e.isLeafNode()&&(e=o.ChildrenNode.EMPTY_NODE);var n=e.withIndex(this.me);n=n.updatePriority(o.ChildrenNode.EMPTY_NODE);var r=this;return e.forEachChild(l.PRIORITY_INDEX,function(a,e){r.matches(new p.NamedNode(a,e))||(n=n.updateImmediateChild(a,o.ChildrenNode.EMPTY_NODE))}),this.Vn.updateFullNode(a,n,t)},r.prototype.updatePriority=function(t){return t},r.prototype.filtersNodes=function(){return!0},r.prototype.getIndexedFilter=function(){return this.Vn},r.prototype.getIndex=function(){return this.me},r.qn=function(n){if(n.hasStart()){var e=n.getIndexStartName();return n.getIndex().makePost(n.getIndexStartValue(),e)}return n.getIndex().minPost()},r.Bn=function(n){if(n.hasEnd()){var e=n.getIndexEndName();return n.getIndex().makePost(n.getIndexEndValue(),e)}return n.getIndex().maxPost()},r}();e.RangedFilter=r},,,,,,,,,,,,,,,,,,,,,,function(o,e,t){o.exports=t(79)},function(m,e,t){'use strict';function n(e){var t=e.INTERNAL.registerService('database',function(o,e,t){return u.RepoManager.getInstance().databaseFromApp(o,t)},{Reference:a.Reference,Query:o.Query,Database:i.Database,enableLogging:s.enableLogging,INTERNAL:l,ServerValue:p,TEST_ACCESS:g},null,!0);y.isNodeSdk()&&(m.exports=t)}Object.defineProperty(e,'__esModule',{value:!0});var r=t(6),i=t(32);e.Database=i.Database;var o=t(36);e.Query=o.Query;var a=t(21);e.Reference=a.Reference;var s=t(1);e.enableLogging=s.enableLogging;var u=t(26),l=t(111),g=t(112),y=t(0),p=i.Database.ServerValue;e.ServerValue=p,e.registerDatabase=n,n(r.default);var b=t(22);e.DataSnapshot=b.DataSnapshot;var f=t(35);e.OnDisconnect=f.OnDisconnect},function(o,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var n=t(0),r=function(){function t(t){this.Hn=t,this.Gn='firebase:'}return t.prototype.set=function(o,e){null==e?this.Hn.removeItem(this.Kn(o)):this.Hn.setItem(this.Kn(o),n.stringify(e))},t.prototype.get=function(o){var e=this.Hn.getItem(this.Kn(o));return null==e?null:n.jsonEval(e)},t.prototype.remove=function(t){this.Hn.removeItem(this.Kn(t))},t.prototype.Kn=function(t){return this.Gn+t},t.prototype.toString=function(){return''+this.Hn},t}();e.DOMStorageWrapper=r},function(o,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var n=t(0),r=function(){function t(){this.Yn={},this.isInMemoryStorage=!0}return t.prototype.set=function(n,e){null==e?delete this.Yn[n]:this.Yn[n]=e},t.prototype.get=function(t){return n.contains(this.Yn,t)?this.Yn[t]:null},t.prototype.remove=function(t){delete this.Yn[t]},t}();e.MemoryStorage=r},function(o,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var n=t(0),r=function(){function t(n,o){this.committed=n,this.snapshot=o}return t.prototype.toJSON=function(){return n.validateArgCount('TransactionResult.toJSON',0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}();e.TransactionResult=r},function(o,e,t){'use strict';var d=Math.floor;Object.defineProperty(e,'__esModule',{value:!0});var l=t(0);e.nextPushId=function(){var o='-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz',e=0,t=[];return function(n){var r=n===e;e=n;var i=Array(8),s;for(s=7;0<=s;s--)i[s]=o.charAt(n%64),n=d(n/64);l.assert(0===n,'Cannot push at time == 0');var a=i.join('');if(r){for(s=11;0<=s&&63===t[s];s--)t[s]=0;t[s]++}else for(s=0;12>s;s++)t[s]=d(64*Math.random());for(s=0;12>s;s++)a+=o.charAt(t[s]);return l.assert(20===a.length,'nextPushId: Length should be 20.'),a}}()},function(d,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var l=t(22),r=t(85),p=t(0),i=t(0),n=function(){function n(o,r,t){this.Xn=o,this.zn=r,this.Jn=t}return n.prototype.respondsTo=function(t){return'value'===t},n.prototype.createEvent=function(o,e){var t=e.getQueryParams().getIndex();return new r.DataEvent('value',this,new l.DataSnapshot(o.snapshotNode,e.getRef(),t))},n.prototype.getEventRunner=function(o){var e=this.Jn;if('cancel'===o.getEventType()){i.assert(this.zn,'Raising a cancel event on a listener with no cancel callback');var t=this.zn;return function(){t.call(e,o.error)}}var n=this.Xn;return function(){n.call(e,o.snapshot)}},n.prototype.createCancelEvent=function(n,e){return this.zn?new r.CancelEvent(this,n,e):null},n.prototype.matches=function(e){return e instanceof n&&(!e.Xn||!this.Xn||e.Xn===this.Xn&&e.Jn===this.Jn)},n.prototype.hasAnyCallback=function(){return null!==this.Xn},n}();e.ValueEventRegistration=n;var o=function(){function o(o,r,t){this.$n=o,this.zn=r,this.Jn=t}return o.prototype.respondsTo=function(n){var e='children_added'===n?'child_added':n;return e='children_removed'==e?'child_removed':e,p.contains(this.$n,e)},o.prototype.createCancelEvent=function(n,e){return this.zn?new r.CancelEvent(this,n,e):null},o.prototype.createEvent=function(a,e){i.assert(null!=a.childName,'Child events should have a childName.');var t=e.getRef().child(a.childName),n=e.getQueryParams().getIndex();return new r.DataEvent(a.type,this,new l.DataSnapshot(a.snapshotNode,t,n),a.prevName)},o.prototype.getEventRunner=function(o){var e=this.Jn;if('cancel'===o.getEventType()){i.assert(this.zn,'Raising a cancel event on a listener with no cancel callback');var t=this.zn;return function(){t.call(e,o.error)}}var n=this.$n[o.eventType];return function(){n.call(e,o.snapshot,o.prevName)}},o.prototype.matches=function(a){if(a instanceof o){if(!this.$n||!a.$n)return!0;if(this.Jn===a.Jn){var e=p.getCount(a.$n);if(e===p.getCount(this.$n)){if(1===e){var t=p.getAnyKey(a.$n),n=p.getAnyKey(this.$n);return!(n!==t||a.$n[t]&&this.$n[n]&&a.$n[t]!==this.$n[n])}return p.every(this.$n,function(t,e){return a.$n[t]===e})}}}return!1},o.prototype.hasAnyCallback=function(){return null!==this.$n},o}();e.ChildEventRegistration=o},function(a,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var n=t(0),r=function(){function t(o,a,t,n){this.eventType=o,this.eventRegistration=a,this.snapshot=t,this.prevName=n}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return'value'===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath()+':'+this.eventType+':'+n.stringify(this.snapshot.exportVal())},t}();e.DataEvent=r;var i=function(){function t(o,r,t){this.eventRegistration=o,this.error=r,this.path=t}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return'cancel'},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path+':cancel'},t}();e.CancelEvent=i},function(m,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var g=t(0),b=t(1),i=t(87),r=t(4),o=t(0),v=t(23),n=t(88),u=t(89),h=t(8),c=t(46),x=t(2),a=t(47),s=t(95),d=function(){function m(t){this.Zn=t,this.er=v.ImmutableTree.Empty,this.tr=new s.WriteTree,this.nr={},this.rr={}}return m.prototype.applyUserOverwrite=function(o,e,t,n){return this.tr.addOverwrite(o,e,t,n),n?this.ir(new c.Overwrite(h.OperationSource.User,o,e)):[]},m.prototype.applyUserMerge=function(o,e,t){this.tr.addMerge(o,e,t);var n=v.ImmutableTree.fromObject(e);return this.ir(new u.Merge(h.OperationSource.User,o,n))},m.prototype.ackUserWrite=function(a,e){void 0===e&&(e=!1);var t=this.tr.getWrite(a);if(this.tr.removeWrite(a)){var n=v.ImmutableTree.Empty;return null==t.snap?o.forEach(t.children,function(o,e){n=n.set(new x.Path(o),e)}):n=n.set(x.Path.Empty,!0),this.ir(new i.AckUserWrite(t.path,n,e))}return[]},m.prototype.applyServerOverwrite=function(n,e){return this.ir(new c.Overwrite(h.OperationSource.Server,n,e))},m.prototype.applyServerMerge=function(o,e){var t=v.ImmutableTree.fromObject(e);return this.ir(new u.Merge(h.OperationSource.Server,o,t))},m.prototype.applyListenComplete=function(t){return this.ir(new n.ListenComplete(h.OperationSource.Server,t))},m.prototype.applyTaggedQueryOverwrite=function(e,t,n){var r=this.or(n);if(null!=r){var i=m.ar(r),o=i.path,a=i.queryId,s=x.Path.relativePath(o,e),d=new c.Overwrite(h.OperationSource.forServerTaggedQuery(a),s,t);return this.sr(o,d)}return[]},m.prototype.applyTaggedQueryMerge=function(e,t,n){var r=this.or(n);if(r){var i=m.ar(r),o=i.path,a=i.queryId,s=x.Path.relativePath(o,e),d=v.ImmutableTree.fromObject(t),l=new u.Merge(h.OperationSource.forServerTaggedQuery(a),s,d);return this.sr(o,l)}return[]},m.prototype.applyTaggedListenComplete=function(e,t){var d=this.or(t);if(d){var r=m.ar(d),i=r.path,o=r.queryId,a=x.Path.relativePath(i,e),s=new n.ListenComplete(h.OperationSource.forServerTaggedQuery(o),a);return this.sr(i,s)}return[]},m.prototype.addEventRegistration=function(e,t){var d=e.path,i=null,o=!1;this.er.foreachOnPath(d,function(r,e){var t=x.Path.relativePath(r,d);i=i||e.getCompleteServerCache(t),o=o||e.hasCompleteView()});var n=this.er.get(d);n?(o=o||n.hasCompleteView(),i=i||n.getCompleteServerCache(x.Path.Empty)):(n=new a.SyncPoint,this.er=this.er.set(d,n));var u;null==i?(u=!1,i=r.ChildrenNode.EMPTY_NODE,this.er.subtree(d).foreachChild(function(o,e){var t=e.getCompleteServerCache(x.Path.Empty);t&&(i=i.updateImmediateChild(o,t))})):u=!0;var l=n.viewExistsForQuery(e);if(!l&&!e.getQueryParams().loadsAllData()){var f=m.ur(e);g.assert(!(f in this.rr),'View does not exist, but we have a tag');var c=m.lr();this.rr[f]=c,this.nr['_'+c]=f}var p=this.tr.childWrites(d),b=n.addEventRegistration(e,t,p,i,u);if(!l&&!o){var y=n.viewForQuery(e);b=b.concat(this.hr(e,y))}return b},m.prototype.removeEventRegistration=function(e,t,n){var r=this,i=e.path,o=this.er.get(i),a=[];if(o&&('default'===e.queryIdentifier()||o.viewExistsForQuery(e))){var s=o.removeEventRegistration(e,t,n);o.isEmpty()&&(this.er=this.er.remove(i));var u=s.removed;a=s.events;var l=-1!==u.findIndex(function(t){return t.getQueryParams().loadsAllData()}),h=this.er.findOnPath(i,function(n,e){return e.hasCompleteView()});if(l&&!h){var g=this.er.subtree(i);if(!g.isEmpty())for(var p=this.cr(g),d=0;dthis.Gr,'Stacking an older write on top of newer ones'),void 0===s&&(s=!0),this.Hr.push({path:o,snap:a,writeId:i,visible:s}),s&&(this.Br=this.Br.addWrite(o,a)),this.Gr=i},d.prototype.addMerge=function(o,r,a){m.assert(a>this.Gr,'Stacking an older merge on top of newer ones'),this.Hr.push({path:o,children:r,writeId:a,visible:!0}),this.Br=this.Br.addWrites(o,r),this.Gr=a},d.prototype.getWrite=function(o){for(var e=0,t;e=e&&this.Kr(d,t.path)?o=!1:t.path.contains(d.path)&&(a=!0)),s--;if(o){if(a)return this.Yr(),!0;if(t.snap)this.Br=this.Br.removeWrite(t.path);else{var l=t.children;n.forEach(l,function(n){i.Br=i.Br.removeWrite(t.path.child(n))})}return!0}return!1},d.prototype.getCompleteWriteData=function(t){return this.Br.getCompleteNode(t)},d.prototype.calcCompleteEventCache=function(o,e,t,n){if(t||n){var u=this.Br.childCompoundWrite(o);if(!n&&u.isEmpty())return e;if(n||null!=e||u.hasCompleteWrite(g.Path.Empty)){var a=function(a){return(a.visible||n)&&(!t||!~t.indexOf(a.writeId))&&(a.path.contains(o)||o.contains(a.path))},s=d.Xr(this.Hr,a,o),l=e||c.ChildrenNode.EMPTY_NODE;return s.apply(l)}return null}var h=this.Br.getCompleteNode(o);if(null!=h)return h;var m=this.Br.childCompoundWrite(o);if(m.isEmpty())return e;if(null!=e||m.hasCompleteWrite(g.Path.Empty)){var l=e||c.ChildrenNode.EMPTY_NODE;return m.apply(l)}return null},d.prototype.calcCompleteEventChildren=function(o,e){var s=c.ChildrenNode.EMPTY_NODE,t=this.Br.getCompleteNode(o);if(t)return t.isLeafNode()||t.forEachChild(a.PRIORITY_INDEX,function(n,e){s=s.updateImmediateChild(n,e)}),s;if(e){var n=this.Br.childCompoundWrite(o);return e.forEachChild(a.PRIORITY_INDEX,function(o,e){var t=n.childCompoundWrite(new g.Path(o)).apply(e);s=s.updateImmediateChild(o,t)}),n.getCompleteChildren().forEach(function(t){s=s.updateImmediateChild(t.name,t.node)}),s}return this.Br.childCompoundWrite(o).getCompleteChildren().forEach(function(t){s=s.updateImmediateChild(t.name,t.node)}),s},d.prototype.calcEventCacheAfterServerOverwrite=function(i,e,t,n){m.assert(t||n,'Either existingEventSnap or existingServerSnap must exist');var r=i.child(e);if(this.Br.hasCompleteWrite(r))return null;var o=this.Br.childCompoundWrite(r);return o.isEmpty()?n.getChild(e):o.apply(n.getChild(e))},d.prototype.calcCompleteChild=function(o,e,t){var n=o.child(e),r=this.Br.getCompleteNode(n);return null==r?t.isCompleteForChild(e)?this.Br.childCompoundWrite(n).apply(t.getNode().getImmediateChild(e)):null:r},d.prototype.shadowingWrite=function(t){return this.Br.getCompleteNode(t)},d.prototype.calcIndexedSlice=function(o,e,t,n,r,i){var a=this.Br.childCompoundWrite(o),u=a.getCompleteNode(g.Path.Empty),l;if(null!=u)l=u;else{if(null==e)return[];l=a.apply(e)}if(l=l.withIndex(i),l.isEmpty()||l.isLeafNode())return[];for(var s=[],h=i.getCompare(),c=r?l.getReverseIteratorFrom(t,i):l.getIteratorFrom(t,i),p=c.getNext();p&&s.lengthl.status){try{r=o.jsonEval(l.responseText)}catch(t){p.warn('Failed to parse JSON response for '+s+': '+l.responseText)}t(null,r)}else 401!==l.status&&404!==l.status&&p.warn('Got unsuccessful REST response for '+s+' Status: '+l.status),t(l.status);t=null}},l.open('GET',s,!0),l.send()})},d}(i.ServerActions);e.ReadonlyRestClient=s},function(m,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var g=t(0),n=t(1),r=t(10),o=t(3),a=t(38),s=t(42),i=t(24),l=t(108),u=t(56),c=t(0),p=function(){function d(){this.fi=!1,this._i=!1,this.yi=!1,this.vi=!1,this.gi=!1,this.mi=0,this.Ci='',this.Ei=null,this.Ni='',this.Pi=null,this.bi='',this.me=o.PRIORITY_INDEX}return d.prototype.hasStart=function(){return this._i},d.prototype.isViewFromLeft=function(){return''===this.Ci?this._i:this.Ci===d.Si.VIEW_FROM_LEFT},d.prototype.getIndexStartValue=function(){return g.assert(this._i,'Only valid if start has been set'),this.Ei},d.prototype.getIndexStartName=function(){return g.assert(this._i,'Only valid if start has been set'),this.yi?this.Ni:n.MIN_NAME},d.prototype.hasEnd=function(){return this.vi},d.prototype.getIndexEndValue=function(){return g.assert(this.vi,'Only valid if end has been set'),this.Pi},d.prototype.getIndexEndName=function(){return g.assert(this.vi,'Only valid if end has been set'),this.gi?this.bi:n.MAX_NAME},d.prototype.hasLimit=function(){return this.fi},d.prototype.hasAnchoredLimit=function(){return this.fi&&''!==this.Ci},d.prototype.getLimit=function(){return g.assert(this.fi,'Only valid if limit has been set'),this.mi},d.prototype.getIndex=function(){return this.me},d.prototype.Ti=function(){var e=new d;return e.fi=this.fi,e.mi=this.mi,e._i=this._i,e.Ei=this.Ei,e.yi=this.yi,e.Ni=this.Ni,e.vi=this.vi,e.Pi=this.Pi,e.gi=this.gi,e.bi=this.bi,e.me=this.me,e.Ci=this.Ci,e},d.prototype.limit=function(n){var e=this.Ti();return e.fi=!0,e.mi=n,e.Ci='',e},d.prototype.limitToFirst=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci=d.Si.VIEW_FROM_LEFT,t},d.prototype.limitToLast=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci=d.Si.VIEW_FROM_RIGHT,t},d.prototype.startAt=function(o,e){var t=this.Ti();return t._i=!0,void 0===o&&(o=null),t.Ei=o,null==e?(t.yi=!1,t.Ni=''):(t.yi=!0,t.Ni=e),t},d.prototype.endAt=function(o,e){var t=this.Ti();return t.vi=!0,void 0===o&&(o=null),t.Pi=o,void 0===e?(t.gi=!1,t.bi=''):(t.gi=!0,t.bi=e),t},d.prototype.orderBy=function(n){var e=this.Ti();return e.me=n,e},d.prototype.getQueryObject=function(){var e=d.Si,t={};if(this._i&&(t[e.INDEX_START_VALUE]=this.Ei,this.yi&&(t[e.INDEX_START_NAME]=this.Ni)),this.vi&&(t[e.INDEX_END_VALUE]=this.Pi,this.gi&&(t[e.INDEX_END_NAME]=this.bi)),this.fi){t[e.LIMIT]=this.mi;var n=this.Ci;''===n&&(n=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),t[e.VIEW_FROM]=n}return this.me!==o.PRIORITY_INDEX&&(t[e.INDEX]=''+this.me),t},d.prototype.loadsAllData=function(){return!(this._i||this.vi||this.fi)},d.prototype.isDefault=function(){return this.loadsAllData()&&this.me==o.PRIORITY_INDEX},d.prototype.getNodeFilter=function(){return this.loadsAllData()?new i.IndexedFilter(this.getIndex()):this.hasLimit()?new l.LimitedFilter(this):new u.RangedFilter(this)},d.prototype.toRestQueryStringParameters=function(){var e=d.wi,t={};if(this.isDefault())return t;var n;return this.me===o.PRIORITY_INDEX?n=e.PRIORITY_INDEX:this.me===a.VALUE_INDEX?n=e.VALUE_INDEX:this.me===r.KEY_INDEX?n=e.KEY_INDEX:(g.assert(this.me instanceof s.PathIndex,'Unrecognized index type!'),n=''+this.me),t[e.ORDER_BY]=c.stringify(n),this._i&&(t[e.START_AT]=c.stringify(this.Ei),this.yi&&(t[e.START_AT]+=','+c.stringify(this.Ni))),this.vi&&(t[e.END_AT]=c.stringify(this.Pi),this.gi&&(t[e.END_AT]+=','+c.stringify(this.bi))),this.fi&&(this.isViewFromLeft()?t[e.LIMIT_TO_FIRST]=this.mi:t[e.LIMIT_TO_LAST]=this.mi),t},d.Si={INDEX_START_VALUE:'sp',INDEX_START_NAME:'sn',INDEX_END_VALUE:'ep',INDEX_END_NAME:'en',LIMIT:'l',VIEW_FROM:'vf',VIEW_FROM_LEFT:'l',VIEW_FROM_RIGHT:'r',INDEX:'i'},d.wi={ORDER_BY:'orderBy',PRIORITY_INDEX:'$priority',VALUE_INDEX:'$value',KEY_INDEX:'$key',START_AT:'startAt',END_AT:'endAt',LIMIT_TO_FIRST:'limitToFirst',LIMIT_TO_LAST:'limitToLast'},d.DEFAULT=new d,d}();e.QueryParams=p},function(d,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var n=t(56),m=t(4),i=t(5),o=t(0),a=t(9),r=function(){function t(t){this.Ii=new n.RangedFilter(t),this.me=t.getIndex(),this.mi=t.getLimit(),this.Ri=!t.isViewFromLeft()}return t.prototype.updateChild=function(o,e,t,n,r,a){return this.Ii.matches(new i.NamedNode(e,t))||(t=m.ChildrenNode.EMPTY_NODE),o.getImmediateChild(e).equals(t)?o:o.numChildren()=this.me.compare(this.Ii.getStartPost(),a):0>=this.me.compare(a,this.Ii.getEndPost())))break;n=n.updateImmediateChild(a.name,a.node),o++}}else{n=e.withIndex(this.me),n=n.updatePriority(m.ChildrenNode.EMPTY_NODE);var r=void 0,u,l,h;if(this.Ri){r=n.getReverseIterator(this.me),u=this.Ii.getEndPost(),l=this.Ii.getStartPost();var c=this.me.getCompare();h=function(n,e){return c(e,n)}}else r=n.getIterator(this.me),u=this.Ii.getStartPost(),l=this.Ii.getEndPost(),h=this.me.getCompare();for(var o=0,p=!1,a;r.hasNext();){a=r.getNext(),!p&&0>=h(u,a)&&(p=!0);var s=p&&o=h(a,l);s?o++:n=n.updateImmediateChild(a.name,m.ChildrenNode.EMPTY_NODE)}}return this.Ii.getIndexedFilter().updateFullNode(i,n,t)},t.prototype.updatePriority=function(t){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.Ii.getIndexedFilter()},t.prototype.getIndex=function(){return this.me},t.prototype.Oi=function(s,e,t,n,r){var u;if(this.Ri){var l=this.me.getCompare();u=function(n,e){return l(e,n)}}else u=this.me.getCompare();var h=s;o.assert(h.numChildren()==this.mi,'');var c=new i.NamedNode(e,t),p=this.Ri?h.getFirstChild(this.me):h.getLastChild(this.me),d=this.Ii.matches(c);if(h.hasChild(e)){for(var f=h.getImmediateChild(e),b=n.getChildAfterChild(this.me,p,this.Ri);null!=b&&(b.name==e||h.hasChild(b.name));)b=n.getChildAfterChild(this.me,b,this.Ri);var y=null==b?1:u(b,c);if(d&&!t.isEmpty()&&0<=y)return null!=r&&r.trackChildChange(a.Change.childChangedChange(e,t,f)),h.updateImmediateChild(e,t);null!=r&&r.trackChildChange(a.Change.childRemovedChange(e,f));var v=h.updateImmediateChild(e,m.ChildrenNode.EMPTY_NODE);return null!=b&&this.Ii.matches(b)?(null!=r&&r.trackChildChange(a.Change.childAddedChange(b.name,b.node)),v.updateImmediateChild(b.name,b.node)):v}return t.isEmpty()?s:d&&0<=u(p,c)?(null!=r&&(r.trackChildChange(a.Change.childRemovedChange(p.name,p.node)),r.trackChildChange(a.Change.childAddedChange(e,t))),h.updateImmediateChild(e,t).updateImmediateChild(p.name,m.ChildrenNode.EMPTY_NODE)):s},t}();e.LimitedFilter=r},function(m,e,t){'use strict';Object.defineProperty(e,'__esModule',{value:!0});var x=t(0),i=t(21),o=t(22),a=t(2),n=t(110),s=t(3),l=t(1),h=t(43),c=t(7),p=t(0),d=t(11),u=t(4),f=t(18),k;!function(t){t[t.RUN=0]='RUN',t[t.SENT=1]='SENT',t[t.COMPLETED=2]='COMPLETED',t[t.SENT_NEEDS_ABORT=3]='SENT_NEEDS_ABORT',t[t.NEEDS_ABORT=4]='NEEDS_ABORT'}(k=e.TransactionStatus||(e.TransactionStatus={})),f.Repo.Ai=25,f.Repo.prototype.ie=function(){this.Di=new n.Tree},f.Repo.prototype.startTransaction=function(r,a,f,v){this.de('transaction on '+r);var A=function(){},L=new i.Reference(this,r);L.on('value',A);var y={path:r,update:a,onComplete:f,status:null,order:l.LUIDGenerator(),applyLocally:v,retryCount:0,unwatcher:function(){L.off('value',A)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},g=this.Mi(r);y.currentInputSnapshot=g;var m=y.update(g.val());if(!(void 0===m)){c.validateFirebaseData('transaction failed: Data returned ',m,y.path),y.status=k.RUN;var R=this.Di.subTree(r),N=R.getValue()||[];N.push(y),R.setValue(N);var O;'object'==typeof m&&null!==m&&p.contains(m,'.priority')?(O=p.safeGet(m,'.priority'),x.assert(c.isValidPriority(O),'Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.')):O=(this.ue.calcCompleteEventCache(r)||u.ChildrenNode.EMPTY_NODE).getPriority().val(),O=O;var b=this.generateServerValues(),S=d.nodeFromJSON(m,O),T=h.resolveDeferredValueSnapshot(S,b);y.currentOutputSnapshotRaw=S,y.currentOutputSnapshotResolved=T,y.currentWriteId=this.pe();var w=this.ue.applyUserOverwrite(r,T,y.currentWriteId,y.applyLocally);this.K.raiseEventsForChangedPath(r,w),this.Li()}else if(y.unwatcher(),y.currentOutputSnapshotRaw=null,y.currentOutputSnapshotResolved=null,y.onComplete){var I=new o.DataSnapshot(y.currentInputSnapshot,new i.Reference(this,y.path),s.PRIORITY_INDEX);y.onComplete(null,!1,I)}},f.Repo.prototype.Mi=function(n,e){return this.ue.calcCompleteEventCache(n,e)||u.ChildrenNode.EMPTY_NODE},f.Repo.prototype.Li=function(o){var r=this;if(void 0===o&&(o=this.Di),o||this.Fi(o),null!==o.getValue()){var e=this.xi(o);x.assert(0=f.Repo.Ai)C=!0,E='maxretry',n=n.concat(this.ue.ackUserWrite(g.currentWriteId,!0));else{var N=this.Mi(g.path,y);g.currentInputSnapshot=N;var L=r[v].update(N.val());if(void 0!==L){c.validateFirebaseData('transaction failed: Data returned ',L,g.path);var P=d.nodeFromJSON(L),S='object'==typeof L&&null!=L&&p.contains(L,'.priority');S||(P=P.updatePriority(N.getPriority()));var T=g.currentWriteId,w=this.generateServerValues(),I=h.resolveDeferredValueSnapshot(P,w);g.currentOutputSnapshotRaw=P,g.currentOutputSnapshotResolved=I,g.currentWriteId=this.pe(),y.splice(y.indexOf(T),1),n=n.concat(this.ue.applyUserOverwrite(g.path,I,g.currentWriteId,g.applyLocally)),n=n.concat(this.ue.ackUserWrite(T,!0))}else C=!0,E='nodata',n=n.concat(this.ue.ackUserWrite(g.currentWriteId,!0))}if(this.K.raiseEventsForChangedPath(e,n),n=[],C&&(r[v].status=k.COMPLETED,function(t){setTimeout(t,0)}(r[v].unwatcher),r[v].onComplete))if('nodata'===E){var R=new i.Reference(this,r[v].path),O=r[v].currentInputSnapshot,A=new o.DataSnapshot(O,R,s.PRIORITY_INDEX);t.push(r[v].onComplete.bind(null,null,!1,A))}else t.push(r[v].onComplete.bind(null,Error(E),!1,null))}this.Fi(this.Di);for(var v=0;v=n)t.push(n);else if(2047>=n)t.push(192|n>>6,128|63&n);else if(55296==(64512&n)){var r=e>18,128|63&n>>12,128|63&n>>6,128|63&n)}else t.push(239,191,189)}else 56320==(64512&n)?t.push(239,191,189):t.push(224|n>>12,128|63&n>>6,128|63&n);return new Uint8Array(t)}function w(n){var t;try{t=decodeURIComponent(n)}catch(e){throw g(ee.DATA_URL,'Malformed data URL.')}return E(t)}function T(d,t){switch(d){case ee.BASE64:var e=-1!==t.indexOf('-'),n=-1!==t.indexOf('_');if(e||n){var r=e?'-':'_';throw g(d,'Invalid character \''+r+'\' found: is it base64url encoded?')}break;case ee.BASE64URL:var o=-1!==t.indexOf('+'),i=-1!==t.indexOf('/');if(o||i){var r=o?'+':'/';throw g(d,'Invalid character \''+r+'\' found: is it base64 encoded?')}t=t.replace(/-/g,'+').replace(/_/g,'/');}var a;try{a=atob(t)}catch(t){throw g(d,'Invalid character found')}for(var s=new Uint8Array(a.length),l=0;l=t.length)&&n.substring(n.length-t.length)===t}function C(e){switch(e){case It.RUNNING:case It.PAUSING:case It.CANCELING:return ae.RUNNING;case It.PAUSED:return ae.PAUSED;case It.SUCCESS:return ae.SUCCESS;case It.CANCELED:return ae.CANCELED;case It.ERROR:default:return ae.ERROR;}}function S(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function k(o,t){for(var e in o)S(o,e)&&t(e,o[e])}function I(n){if(null==n)return{};var o={};return k(n,function(e,t){o[e]=t}),o}function L(e){return new Promise(e)}function O(e){return Promise.resolve(e)}function x(e){return Promise.reject(e)}function P(e){return null!=e}function D(e){return void 0!==e}function _(e){return'function'==typeof e}function M(e){return'object'==typeof e}function B(e){return M(e)&&null!==e}function U(e){return M(e)&&!Array.isArray(e)}function W(e){return'string'==typeof e||e instanceof String}function F(e){return'number'==typeof e||e instanceof Number}function H(e){return q()&&e instanceof Blob}function q(){return'undefined'!=typeof Blob}function j(n){var t;try{t=JSON.parse(n)}catch(e){return null}return U(t)?t:null}function V(n){if(0==n.length)return null;var t=n.lastIndexOf('/');return-1===t?'':n.slice(0,t)}function z(o,t){var e=t.split('/').filter(function(e){return 0e.length?e:(e=e,K(e))}function Z(){function a(n,o){return $(o)}function t(n,t){return P(t)?+t:t}function e(a,t){if(!(W(t)&&0t;t++)n+=(''+Math.random()).slice(2);return n}();i['Content-Type']='multipart/related; boundary='+a;var s=it(t,n,r),u=De(s,e),c='--'+a+'\r\nContent-Type: application/json; charset=utf-8\r\n\r\n'+u+'\r\n--'+a+'\r\nContent-Type: '+s.contentType+'\r\n\r\n',l=fe.getBlob(c,n,'\r\n--'+a+'--');if(null===l)throw ke();var p={name:s.fullPath},d=Q(o),m=h.maxUploadRetryTime(),g=new de(d,'POST',Ze(h,e),m);return g.urlParams=p,g.headers=i,g.body=l.uploadData(),g.errorHandler=et(t),g}function dt(o,t){var e;try{e=o.getResponseHeader('X-Goog-Upload-Status')}catch(e){$e(!1)}return $e(Qe(t||['active'],e)),e}function lt(i,t,e,n,r){var o=t.bucketOnlyServerUrl(),a=it(t,n,r),s={name:a.fullPath},d=Q(o),c={"X-Goog-Upload-Protocol":'resumable',"X-Goog-Upload-Command":'start',"X-Goog-Upload-Header-Content-Length":n.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":'application/json; charset=utf-8'},l=De(a,e),u=i.maxUploadRetryTime(),p=new de(d,'POST',function(e){dt(e);var t;try{t=e.getResponseHeader('X-Goog-Upload-URL')}catch(e){$e(!1)}return $e(W(t)),t},u);return p.urlParams=s,p.headers=c,p.body=l,p.errorHandler=et(t),p}function pt(i,t,e,d){function n(e){var t=dt(e,['active','final']),r;try{r=e.getResponseHeader('X-Goog-Upload-Size-Received')}catch(e){$e(!1)}var n=parseInt(r,10);return $e(!isNaN(n)),new _e(n,d.size(),'final'===t)}var o=i.maxUploadRetryTime(),r=new de(e,'POST',n,o);return r.headers={"X-Goog-Upload-Command":'query'},r.errorHandler=et(t),r}function ct(d,x,e,C,t,r,n,o){function a(e,t){var n=dt(e,['active','final']),a=i.current+l,s=C.size(),d;return d='final'===n?Ze(x,r)(e,t):null,new _e(a,s,'final'===n,d)}var i=new _e(0,0);if(n?(i.current=n.current,i.total=n.total):(i.current=0,i.total=C.size()),C.size()!==i.total)throw f();var s=i.total-i.current,l=s;0s&&(s*=2);var d;1===l?(l=2,d=0):d=1e3*(s+Math.random()),o(d)}}function a(e){m||(m=!0,h||(null===u?e||(l=1):(e||(l=2),clearTimeout(u),o(0))))}var s=1,u=null,c=!1,l=0,h=!1,m=!1;return o(0),setTimeout(function(){c=!0,a(!0)},e),a}function mt(e){e(!1)}function gt(n,t){null!==t&&0][;base64],');var e=r[1]||null;null!=e&&(this.base64=R(e,';base64'),this.contentType=this.base64?e.substring(0,e.length-7):e),this.rest=o.substring(o.indexOf(',')+1)}return e}(),oe={STATE_CHANGED:'state_changed'},It={RUNNING:'running',PAUSING:'pausing',PAUSED:'paused',SUCCESS:'success',CANCELING:'canceling',CANCELED:'canceled',ERROR:'error'},ae={RUNNING:'running',PAUSED:'paused',SUCCESS:'success',CANCELED:'canceled',ERROR:'error'},Nt;!function(e){e[e.NO_ERROR=0]='NO_ERROR',e[e.NETWORK_ERROR=1]='NETWORK_ERROR',e[e.ABORT=2]='ABORT'}(Nt||(Nt={}));var At=function(){function e(){var n=this;this.o=!1,this.i=new XMLHttpRequest,this.a=Nt.NO_ERROR,this.s=L(function(t){n.i.addEventListener('abort',function(){n.a=Nt.ABORT,t(n)}),n.i.addEventListener('error',function(){n.a=Nt.NETWORK_ERROR,t(n)}),n.i.addEventListener('load',function(){t(n)})})}return e.prototype.send=function(a,t,e,n){var r=this;if(this.o)throw y('cannot .send() more than once');return this.o=!0,this.i.open(t,a,!0),P(n)&&k(n,function(n,t){r.i.setRequestHeader(n,''+t)}),P(e)?this.i.send(e):this.i.send(),this.s},e.prototype.getErrorCode=function(){if(!this.o)throw y('cannot .getErrorCode() before sending');return this.a},e.prototype.getStatus=function(){if(!this.o)throw y('cannot .getStatus() before sending');try{return this.i.status}catch(e){return-1}},e.prototype.getResponseText=function(){if(!this.o)throw y('cannot .getResponseText() before sending');return this.i.responseText},e.prototype.abort=function(){this.i.abort()},e.prototype.getResponseHeader=function(e){return this.i.getResponseHeader(e)},e.prototype.addUploadProgressListener=function(e){P(this.i.upload)&&this.i.upload.addEventListener('progress',e)},e.prototype.removeUploadProgressListener=function(e){P(this.i.upload)&&this.i.upload.removeEventListener('progress',e)},e}(),ue=function(){function e(){}return e.prototype.createXhrIo=function(){return new At},e}(),ce=function(){function r(n,o){this.bucket=n,this.u=o}return Object.defineProperty(r.prototype,'path',{get:function(){return this.u},enumerable:!0,configurable:!0}),r.prototype.fullServerUrl=function(){var e=encodeURIComponent;return'/b/'+e(this.bucket)+'/o/'+e(this.path)},r.prototype.bucketOnlyServerUrl=function(){return'/b/'+encodeURIComponent(this.bucket)+'/o'},r.makeFromBucketSpec=function(t){var e;try{e=r.makeFromUrl(t)}catch(e){return new r(t,'')}if(''===e.path)return e;throw l(t)},r.makeFromUrl=function(t){function e(e){'/'===e.path.charAt(e.path.length-1)&&(e.u=e.u.slice(0,-1))}function h(e){e.u=decodeURIComponent(e.path)}for(var m=null,o=/^gs:\/\/([A-Za-z0-9.\-]+)(\/(.*))?$/i,g={bucket:1,path:3},y=/^https?:\/\/firebasestorage\.googleapis\.com\/v[A-Za-z0-9_]+\/b\/([A-Za-z0-9.\-]+)\/o(\/([^?#]*).*)?$/i,b={bucket:1,path:3},v=[{regex:o,indices:g,postModify:e},{regex:y,indices:b,postModify:h}],c=0;c262144*this.g&&(this.g*=2)},e.prototype.q=function(){var o=this;this.z(function(t){var e=nt(o.U,o.T,o.O),n=o.U.makeRequest(e,t);o.m=n,n.getPromise().then(function(t){o.m=null,o.N=t,o.P(It.SUCCESS)},o.x)})},e.prototype.H=function(){var o=this;this.z(function(t){var e=st(o.U,o.T,o.O,o.A,o.N),n=o.U.makeRequest(e,t);o.m=n,n.getPromise().then(function(t){o.m=null,o.N=t,o.B(o.A.size()),o.P(It.SUCCESS)},o.I)})},e.prototype.B=function(n){var t=this.p;this.p=n,this.p!==t&&this.V()},e.prototype.P=function(n){if(this.k!==n)switch(n){case It.CANCELING:case It.PAUSING:this.k=n,null!==this.m&&this.m.cancel();break;case It.RUNNING:var t=this.k===It.PAUSED;this.k=n,t&&(this.V(),this.M());break;case It.PAUSED:this.k=n,this.V();break;case It.CANCELED:this.v=c(),this.k=n,this.V();break;case It.ERROR:case It.SUCCESS:this.k=n,this.V();}},e.prototype.L=function(){switch(this.k){case It.PAUSING:this.P(It.PAUSED);break;case It.CANCELING:this.P(It.CANCELED);break;case It.RUNNING:this.M();}},Object.defineProperty(e.prototype,'snapshot',{get:function(){var e=C(this.k);return new be(this.p,this.A.size(),e,this.N,this,this.w)},enumerable:!0,configurable:!0}),e.prototype.on=function(o,t,e,s){function n(e){try{return void i(e)}catch(e){}try{if(d(e),!(D(e.next)||D(e.error)||D(e.complete)))throw''}catch(e){throw a}}function r(o){function t(t,r){null!==o&&Fe('on',o,arguments);var n=new ve(t,r,s);return l.K(n),function(){l.Z(n)}}return t}void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===s&&(s=void 0);var a='Expected a function or an Object with one of `next`, `error`, `complete` properties.',i=ze(!0).validator,d=je(null,!0).validator;Fe('on',[Ve(function(){if(o!==oe.STATE_CHANGED)throw'Expected one of the event types: ['+oe.STATE_CHANGED+'].'}),je(n,!0),ze(!0),ze(!0)],arguments);var l=this,c=[je(function(e){if(null===e)throw a;n(e)}),ze(!0),ze(!0)];return D(t)||D(e)||D(s)?r(null)(t,e,s):r(c)},e.prototype.then=function(n,t){return this.D.then(n,t)},e.prototype.catch=function(e){return this.then(null,e)},e.prototype.K=function(e){this._.push(e),this.J(e)},e.prototype.Z=function(e){Je(this._,e)},e.prototype.V=function(){var n=this;this.Q(),Ye(this._).forEach(function(t){n.J(t)})},e.prototype.Q=function(){if(null!==this.y){var e=!0;switch(C(this.k)){case ae.SUCCESS:ut(this.y.bind(null,this.snapshot))();break;case ae.CANCELED:case ae.ERROR:ut(this.R.bind(null,this.v))();break;default:e=!1;}e&&(this.y=null,this.R=null)}},e.prototype.J=function(e){switch(C(this.k)){case ae.RUNNING:case ae.PAUSED:null!==e.next&&ut(e.next.bind(e,this.snapshot))();break;case ae.SUCCESS:null!==e.complete&&ut(e.complete.bind(e))();break;case ae.CANCELED:case ae.ERROR:null!==e.error&&ut(e.error.bind(e,this.v))();break;default:null!==e.error&&ut(e.error.bind(e,this.v))();}},e.prototype.resume=function(){Fe('resume',[],arguments);var e=this.k===It.PAUSED||this.k===It.PAUSING;return e&&this.P(It.RUNNING),e},e.prototype.pause=function(){Fe('pause',[],arguments);var e=this.k===It.RUNNING;return e&&this.P(It.PAUSING),e},e.prototype.cancel=function(){Fe('cancel',[],arguments);var e=this.k===It.RUNNING||this.k===It.PAUSING;return e&&this.P(It.CANCELING),e},e}(),ge=function(){function o(n,o){this.authWrapper=n,this.location=o instanceof ce?o:ce.makeFromUrl(o)}return o.prototype.toString=function(){return Fe('toString',[],arguments),'gs://'+this.location.bucket+'/'+this.location.path},o.prototype.newRef=function(t,e){return new o(t,e)},o.prototype.mappings=function(){return Z()},o.prototype.child=function(o){Fe('child',[Ve()],arguments);var t=z(this.location.path,o),e=new ce(this.location.bucket,t);return this.newRef(this.authWrapper,e)},Object.defineProperty(o.prototype,'parent',{get:function(){var n=V(this.location.path);if(null===n)return null;var t=new ce(this.location.bucket,n);return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,'root',{get:function(){var e=new ce(this.location.bucket,'');return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,'bucket',{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,'fullPath',{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,'name',{get:function(){return K(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,'storage',{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),o.prototype.put=function(n,t){return void 0===t&&(t=null),Fe('put',[We(),He(!0)],arguments),this.Y('put'),new me(this,this.authWrapper,this.location,this.mappings(),new fe(n),t)},o.prototype.putString=function(a,t,e){void 0===t&&(t=ee.RAW),Fe('putString',[Ve(),Ve(b,!0),He(!0)],arguments),this.Y('putString');var n=v(t,a),r=I(e);return!P(r.contentType)&&P(n.contentType)&&(r.contentType=n.contentType),new me(this,this.authWrapper,this.location,this.mappings(),new fe(n.data,!0),r)},o.prototype.delete=function(){Fe('delete',[],arguments),this.Y('delete');var o=this;return this.authWrapper.getAuthToken().then(function(t){var e=rt(o.authWrapper,o.location);return o.authWrapper.makeRequest(e,t).getPromise()})},o.prototype.getMetadata=function(){Fe('getMetadata',[],arguments),this.Y('getMetadata');var o=this;return this.authWrapper.getAuthToken().then(function(t){var e=nt(o.authWrapper,o.location,o.mappings());return o.authWrapper.makeRequest(e,t).getPromise()})},o.prototype.updateMetadata=function(o){Fe('updateMetadata',[He()],arguments),this.Y('updateMetadata');var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=ot(t.authWrapper,t.location,o,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()})},o.prototype.getDownloadURL=function(){return Fe('getDownloadURL',[],arguments),this.Y('getDownloadURL'),this.getMetadata().then(function(n){var t=n.downloadURLs[0];if(P(t))return t;throw d()})},o.prototype.Y=function(e){if(''===this.location.path)throw m(e)},o}(),Lt=function(){function e(e){this.D=x(e)}return e.prototype.getPromise=function(){return this.D},e.prototype.cancel=function(e){void 0===e&&(e=!1)},e}(),Re=function(){function e(){this.$={},this.tt=-9007199254740991}return e.prototype.addRequest=function(o){function t(){delete n.$[e]}var e=this.tt;this.tt++,this.$[e]=o;var n=this;o.getPromise().then(t,t)},e.prototype.clear=function(){k(this.$,function(n,t){t&&t.cancel(!0)}),this.$={}},e}(),Ee=function(){function e(t,s,n,r,o){if(this.et=null,this.nt=!1,this.rt=t,null!==this.rt){var i=this.rt.options;P(i)&&(this.et=e.ot(i))}this.it=s,this.at=n,this.st=o,this.ut=r,this.ct=12e4,this.lt=6e4,this.ht=new Re}return e.ot=function(n){var t=n.storageBucket||null;return null==t?null:ce.makeFromBucketSpec(t).bucket},e.prototype.getAuthToken=function(){return null!==this.rt&&P(this.rt.INTERNAL)&&P(this.rt.INTERNAL.getToken)?this.rt.INTERNAL.getToken().then(function(e){return null===e?null:e.accessToken},function(){return null}):O(null)},e.prototype.bucket=function(){if(this.nt)throw h();return this.et},e.prototype.service=function(){return this.ut},e.prototype.makeStorageReference=function(e){return this.it(this,e)},e.prototype.makeRequest=function(o,t){if(this.nt)return new Lt(h());var e=this.at(o,t,this.st);return this.ht.addRequest(e),e},e.prototype.deleteApp=function(){this.nt=!0,this.rt=null,this.ht.clear()},e.prototype.maxUploadRetryTime=function(){return this.lt},e.prototype.setMaxUploadRetryTime=function(e){this.lt=e},e.prototype.maxOperationRetryTime=function(){return this.ct},e.prototype.setMaxOperationRetryTime=function(e){this.ct=e},e}(),we=function(){function e(d,p,e,n,r,o,i,a,s,u,c){this.pt=null,this.ft=null,this.y=null,this.R=null,this.dt=!1,this._t=!1,this.vt=d,this.bt=p,this.mt=e,this.gt=n,this.yt=r.slice(),this.Rt=o.slice(),this.Et=i,this.wt=a,this.Ut=u,this.Tt=s,this.st=c;var l=this;this.D=L(function(n,t){l.y=n,l.R=t,l.M()})}return e.prototype.M=function(){function o(n,a){function l(n){var t=n.loaded,e=n.lengthComputable?n.total:-1;null!==d.Ut&&d.Ut(t,e)}if(a)return void n(!1,new Ue(!1,null,!0));var e=d.st.createXhrIo();d.pt=e,null!==d.Ut&&e.addUploadProgressListener(l),e.send(d.vt,d.bt,d.gt,d.mt).then(function(t){null!==d.Ut&&t.removeUploadProgressListener(l),d.pt=null,t=t;var e=t.getErrorCode()===Nt.NO_ERROR,r=t.getStatus();if(!e||d.At(r)){var i=t.getErrorCode()===Nt.ABORT;return void n(!1,new Ue(!1,null,i))}var a=Qe(d.yt,r);n(!0,new Ue(a,t))})}function t(n,t){var o=d.y,l=d.R,i=t.xhr;if(t.wasSuccessCode)try{var a=d.Et(i,i.getResponseText());D(a)?o(a):o()}catch(e){l(e)}else if(null!==i){var p=r();p.setServerResponseProp(i.getResponseText()),l(d.wt?d.wt(i,p):p)}else if(t.canceled){var p=d._t?h():c();l(p)}else{var p=s();l(p)}}var d=this;this.dt?t(!1,new Ue(!1,null,!0)):this.ft=ht(o,t,this.Tt)},e.prototype.getPromise=function(){return this.D},e.prototype.cancel=function(e){this.dt=!0,this._t=e||!1,null!==this.ft&&mt(this.ft),null!==this.pt&&this.pt.abort()},e.prototype.At=function(e){var t=Qe([408,429],e),n=Qe(this.Rt,e);return 500<=e&&600>e||t||n},e}(),Ue=function(){function e(o,r,e){this.wasSuccessCode=o,this.xhr=r,this.canceled=!!e}return e}(),Te=function(){function e(r,a,e){if(this.et=null,this.U=new Ee(r,function(n,t){return new ge(n,t)},yt,this,a),this.rt=r,null!=e)this.et=ce.makeFromBucketSpec(e);else{var n=this.U.bucket();null!=n&&(this.et=new ce(n,''))}this.Nt=new Rt(this)}return e.prototype.ref=function(e){if(Fe('ref',[Ve(function(e){if(/^[A-Za-z]+:\/\//.test(e))throw'Expected child path but got a URL, use refFromURL instead.'},!0)],arguments),null==this.et)throw Error('No Storage Bucket defined in Firebase Options.');var t=new ge(this.U,this.et);return null==e?t:t.child(e)},e.prototype.refFromURL=function(e){return Fe('refFromURL',[Ve(function(e){if(!/^[A-Za-z]+:\/\//.test(e))throw'Expected full URL but got a child path, use ref instead.';try{ce.makeFromUrl(e)}catch(e){throw'Expected valid full URL but got an invalid one.'}},!1)],arguments),new ge(this.U,e)},Object.defineProperty(e.prototype,'maxUploadRetryTime',{get:function(){return this.U.maxUploadRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxUploadRetryTime=function(e){Fe('setMaxUploadRetryTime',[qe()],arguments),this.U.setMaxUploadRetryTime(e)},Object.defineProperty(e.prototype,'maxOperationRetryTime',{get:function(){return this.U.maxOperationRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxOperationRetryTime=function(e){Fe('setMaxOperationRetryTime',[qe()],arguments),this.U.setMaxOperationRetryTime(e)},Object.defineProperty(e.prototype,'app',{get:function(){return this.rt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'INTERNAL',{get:function(){return this.Nt},enumerable:!0,configurable:!0}),e}(),Rt=function(){function e(e){this.ut=e}return e.prototype.delete=function(){return this.ut.U.deleteApp(),O(void 0)},e}();t.registerStorage=vt;var Ne='storage';vt(xt.default)}},[118])}catch(e){throw Error('Cannot instantiate firebase-storage.js - be sure to load firebase-app.js first.')}try{webpackJsonpFirebase([1],{113:function(o,t,e){e(114)},114:function(Mn,t,e){'use strict';function n(){return qt}function r(e){qt=e}function So(s,t){for(var e=[],n=2;nn)throw new Ht(Gt.INVALID_ARGUMENT,'Function '+o+'() requires between '+e+' and '+n+' arguments, but was called with '+O(t.length,'argument')+'.')}function y(o,t,e,n){if(!(t instanceof Array)||t.lengthr.indexOf(t))throw new Ht(Gt.INVALID_ARGUMENT,'Unknown option \''+t+'\' passed to function '+o+'(). Available options: '+r.join(', '))})}function A(a,t,e,n){var r=k(n);return new Ht(Gt.INVALID_ARGUMENT,'Function '+a+'() requires its '+R(e)+' argument to be a '+t+', but it was: '+r)}function R(e){return 1===e?'first':2===e?'second':3===e?'third':e+'th'}function O(n,t){return n+' '+t+(1===n?'':'s')}function P(n,t){return nt?1:0}function L(n,t){return null!==n&&void 0!==n?t&&n.equals(t):n===t}function x(o,t){if(o.length!==t.length)return!1;for(var e=0;et?1:n===t?0:isNaN(n)?isNaN(t)?0:-1:1}function U(n,t){return n===t?0!==n||1/n==1/t:n!==n&&t!==t}function V(e){return null===e||void 0===e}function q(e){return _e(e)&&e<=Me&&e>=Oe}function W(o,t,e){if(e.equals(ge.INSTANCE)){if(t!==Le.EQUAL)throw new Ht(Gt.INVALID_ARGUMENT,'Invalid query. You can only perform equals comparisons on null.');return new Be(o)}if(e.equals(Ie.NAN)){if(t!==Le.EQUAL)throw new Ht(Gt.INVALID_ARGUMENT,'Invalid query. You can only perform equals comparisons on NaN.');return new Ue(o)}return new xe(o,t,e)}function j(e){return e===Gt.OK?Wo('Treated status OK as error'):e===Gt.CANCELLED||e===Gt.UNKNOWN||e===Gt.DEADLINE_EXCEEDED||e===Gt.RESOURCE_EXHAUSTED||e===Gt.INTERNAL||e===Gt.UNAVAILABLE||e===Gt.UNAUTHENTICATED?!1:e===Gt.INVALID_ARGUMENT||e===Gt.NOT_FOUND||e===Gt.ALREADY_EXISTS||e===Gt.PERMISSION_DENIED||e===Gt.FAILED_PRECONDITION||e===Gt.ABORTED||e===Gt.OUT_OF_RANGE||e===Gt.UNIMPLEMENTED||e===Gt.DATA_LOSS||Wo('Unknown status code: '+e)}function H(n){var t=cn[n];if(void 0!==t)return z(t)}function z(e){if(void 0===e)return o('GRPC error has no .code'),Gt.UNKNOWN;return e===cn.OK?Gt.OK:e===cn.CANCELLED?Gt.CANCELLED:e===cn.UNKNOWN?Gt.UNKNOWN:e===cn.DEADLINE_EXCEEDED?Gt.DEADLINE_EXCEEDED:e===cn.RESOURCE_EXHAUSTED?Gt.RESOURCE_EXHAUSTED:e===cn.INTERNAL?Gt.INTERNAL:e===cn.UNAVAILABLE?Gt.UNAVAILABLE:e===cn.UNAUTHENTICATED?Gt.UNAUTHENTICATED:e===cn.INVALID_ARGUMENT?Gt.INVALID_ARGUMENT:e===cn.NOT_FOUND?Gt.NOT_FOUND:e===cn.ALREADY_EXISTS?Gt.ALREADY_EXISTS:e===cn.PERMISSION_DENIED?Gt.PERMISSION_DENIED:e===cn.FAILED_PRECONDITION?Gt.FAILED_PRECONDITION:e===cn.ABORTED?Gt.ABORTED:e===cn.OUT_OF_RANGE?Gt.OUT_OF_RANGE:e===cn.UNIMPLEMENTED?Gt.UNIMPLEMENTED:e===cn.DATA_LOSS?Gt.DATA_LOSS:Wo('Unknown status code: '+e)}function K(e){if(void 0===e)return cn.OK;return e===Gt.OK?cn.OK:e===Gt.CANCELLED?cn.CANCELLED:e===Gt.UNKNOWN?cn.UNKNOWN:e===Gt.DEADLINE_EXCEEDED?cn.DEADLINE_EXCEEDED:e===Gt.RESOURCE_EXHAUSTED?cn.RESOURCE_EXHAUSTED:e===Gt.INTERNAL?cn.INTERNAL:e===Gt.UNAVAILABLE?cn.UNAVAILABLE:e===Gt.UNAUTHENTICATED?cn.UNAUTHENTICATED:e===Gt.INVALID_ARGUMENT?cn.INVALID_ARGUMENT:e===Gt.NOT_FOUND?cn.NOT_FOUND:e===Gt.ALREADY_EXISTS?cn.ALREADY_EXISTS:e===Gt.PERMISSION_DENIED?cn.PERMISSION_DENIED:e===Gt.FAILED_PRECONDITION?cn.FAILED_PRECONDITION:e===Gt.ABORTED?cn.ABORTED:e===Gt.OUT_OF_RANGE?cn.OUT_OF_RANGE:e===Gt.UNIMPLEMENTED?cn.UNIMPLEMENTED:e===Gt.DATA_LOSS?cn.DATA_LOSS:Wo('Unknown status code: '+e)}function G(e){return 200===e?Gt.OK:400===e?Gt.INVALID_ARGUMENT:401===e?Gt.UNAUTHENTICATED:403===e?Gt.PERMISSION_DENIED:404===e?Gt.NOT_FOUND:409===e?Gt.ABORTED:416===e?Gt.OUT_OF_RANGE:429===e?Gt.RESOURCE_EXHAUSTED:499===e?Gt.CANCELLED:500===e?Gt.UNKNOWN:501===e?Gt.UNIMPLEMENTED:503===e?Gt.UNAVAILABLE:504===e?Gt.DEADLINE_EXCEEDED:200<=e&&300>e?Gt.OK:400<=e&&500>e?Gt.FAILED_PRECONDITION:500<=e&&600>e?Gt.INTERNAL:Gt.UNKNOWN}function X(){return ln}function Q(){return fn}function Y(){return dn}function J(){return pn}function $(n,t){0i||i>t-2)&&Wo('Invalid encoded resource path: "'+n+'"'),n.charAt(i+1)){case ir:var a=n.substring(o,i),s=void 0;0===r.length?s=a:(r+=a,s=r,r=''),e.push(s);break;case sr:r+=n.substring(o,i),r+='\0';break;case lr:r+=n.substring(o,i+1);break;default:Wo('Invalid encoded resource path: "'+n+'"');}o=i+2}return new re(e)}function lt(n,t){Ho(0===t,'Unexpected upgrade from version '+t),n.createObjectStore(pr.store,{keyPath:pr.keyPath}),n.createObjectStore(ur.store,{keyPath:ur.keyPath}),n.createObjectStore(yr.store,{keyPath:yr.keyPath}).createIndex(yr.documentTargetsIndex,yr.documentTargetsKeyPath,{unique:!0}),n.createObjectStore(fr.store,{keyPath:fr.keyPath}).createIndex(fr.queryTargetsIndexName,fr.queryTargetsKeyPath,{unique:!0}),n.createObjectStore(hr.store),n.createObjectStore(gr.store),n.createObjectStore(dr.store),n.createObjectStore(br.store)}function ct(o){return new Gn(function(r,e){o.onsuccess=function(e){var t=e.target.result;r(t)},o.onerror=function(n){e(n.target.error)}})}function dt(e){return Ho('string'==typeof e,'Persisting non-string stream token not supported.'),e}function pt(e){return mt(e,ur.store)}function ut(e){return mt(e,hr.store)}function ht(e){return mt(e,pr.store)}function mt(n,t){return n instanceof Cr?n.store(t):Wo('Invalid transaction object provided!')}function gt(e){return bt(e,fr.store)}function ft(e){return bt(e,br.store)}function yt(e){return bt(e,yr.store)}function bt(n,t){return n instanceof Cr?n.store(t):Wo('Invalid transaction object provided!')}function vt(e){return e instanceof Cr?e.store(gr.store):Wo('Invalid transaction object provided!')}function Et(e){return e.path.toArray()}function St(e){return void 0!==e.documents}function Ct(e){if(!e)return new ao;switch(e.type){case'gapi':return new co(e.client,e.sessionIndex||'0');case'provider':return e.client;default:throw new Ht(Gt.INVALID_ARGUMENT,'makeCredentialsProvider failed due to invalid credential type');}}function Tt(e){return kt(e,['next','error','complete'])}function kt(a,s){if('object'!=typeof a||null===a)return!1;for(var e=a,n=0,r=s,o;nt.query.docComparator(r,a.doc),'Got added events in wrong order'),r=a.doc,{type:'added',doc:o,oldIndex:-1,newIndex:e++}})}var d=t.oldDocs;return t.docChanges.map(function(e){var n=new Oo(s,e.doc.key,e.doc,t.fromCache),o=-1,l=-1;return e.type!==Ln.Added&&(o=d.indexOf(e.doc.key),Ho(0<=o,'Index for document not found'),d=d.delete(e.doc.key)),e.type!==Ln.Removed&&(d=d.add(e.doc),l=d.indexOf(e.doc.key)),{type:Dt(e.type),doc:n,oldIndex:o,newIndex:l}})}function Dt(e){return e===Ln.Added?'added':e===Ln.Modified||e===Ln.Metadata?'modified':e===Ln.Removed?'removed':Wo('Unknown change type: '+e)}function _t(e){e.INTERNAL.registerService('firestore',function(e){return new ko(e)},h(na))}function Mt(e){_t(e)}var Ft=Number.POSITIVE_INFINITY,Bt=String.fromCharCode,Ut=Math.floor,Vt=Math.min;Object.defineProperty(t,'__esModule',{value:!0});var zo=e(6),jt=zo.default.SDK_VERSION,Qt;!function(e){e[e.DEBUG=0]='DEBUG',e[e.ERROR=1]='ERROR',e[e.SILENT=2]='SILENT'}(Qt||(Qt={}));var qt=Qt.ERROR,Kt=function(){function n(){}return n.setPlatform=function(t){n.platform&&Wo('Platform already defined'),n.platform=t},n.getPlatform=function(){return n.platform||Wo('Platform not set'),n.platform},n}(),Wt=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gt={OK:'ok',CANCELLED:'cancelled',UNKNOWN:'unknown',INVALID_ARGUMENT:'invalid-argument',DEADLINE_EXCEEDED:'deadline-exceeded',NOT_FOUND:'not-found',ALREADY_EXISTS:'already-exists',PERMISSION_DENIED:'permission-denied',UNAUTHENTICATED:'unauthenticated',RESOURCE_EXHAUSTED:'resource-exhausted',FAILED_PRECONDITION:'failed-precondition',ABORTED:'aborted',OUT_OF_RANGE:'out-of-range',UNIMPLEMENTED:'unimplemented',INTERNAL:'internal',UNAVAILABLE:'unavailable',DATA_LOSS:'data-loss'},Ht=function(o){function t(t,a){var n=o.call(this,a)||this;return n.code=t,n.message=a,n.name='FirebaseError',n.toString=function(){return n.name+': [code='+n.code+']: '+n.message},n}return Wt(t,o),t}(Error),zt=function(){function e(){}return e.newId=function(){for(var o='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',t='',e=0;20>e;e++)t+=o.charAt(Ut(Math.random()*o.length));return Ho(20===t.length,'Invalid auto ID: '+t),t},e}(),Xt=function(){function n(e){F(),this.e=e}return n.fromBase64String=function(t){m('Blob.fromBase64String',arguments,1),b('Blob.fromBase64String','string',1,t),F();try{return new n(Kt.getPlatform().atob(t))}catch(e){throw new Ht(Gt.INVALID_ARGUMENT,'Failed to construct Blob from Base64 string: '+e)}},n.fromUint8Array=function(t){if(m('Blob.fromUint8Array',arguments,1),M(),!(t instanceof Uint8Array))throw A('Blob.fromUint8Array','Uint8Array',1,t);return new n(Array.prototype.map.call(t,function(e){return Bt(e)}).join(''))},n.prototype.toBase64=function(){return m('Blob.toBase64',arguments,0),F(),Kt.getPlatform().btoa(this.e)},n.prototype.toUint8Array=function(){m('Blob.toUint8Array',arguments,0),M();for(var n=new Uint8Array(this.e.length),t=0;tn||90o||180o.length&&Wo('offset '+t+' out of range '+o.length),void 0===e?e=o.length-t:e>o.length-t&&Wo('length '+e+' out of range '+(o.length-t)),this.segments=o,this.offset=t,this.len=e},o.prototype.construct=function(o,t,e){var n=Object.create(Object.getPrototypeOf(this));return n.init(o,t,e),n},Object.defineProperty(o.prototype,'length',{get:function(){return this.len},enumerable:!0,configurable:!0}),o.prototype.equals=function(t){return 0===o.comparator(this,t)},o.prototype.child=function(t){var r=this.segments.slice(this.offset,this.limit());return t instanceof o?t.forEach(function(e){r.push(e)}):'string'==typeof t?r.push(t):Wo('Unknown parameter type for Path.child(): '+t),this.construct(r)},o.prototype.limit=function(){return this.offset+this.length},o.prototype.popFirst=function(e){return e=void 0===e?1:e,Ho(this.length>=e,'Can\'t call popFirst() with less segments'),this.construct(this.segments,this.offset+e,this.length-e)},o.prototype.popLast=function(){return Ho(!this.isEmpty(),'Can\'t call popLast() on empty path'),this.construct(this.segments,this.offset,this.length-1)},o.prototype.firstSegment=function(){return Ho(!this.isEmpty(),'Can\'t call firstSegment() on empty path'),this.segments[this.offset]},o.prototype.lastSegment=function(){return Ho(!this.isEmpty(),'Can\'t call lastSegment() on empty path'),this.segments[this.limit()-1]},o.prototype.get=function(e){return Ho(eo)return 1}return a.lengtht.length?1:0},o}(),re=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return ee(o,n),o.prototype.canonicalString=function(){return this.toArray().join('/')},o.prototype.toString=function(){return this.canonicalString()},o.fromString=function(e){if(0<=e.indexOf('//'))throw new Ht(Gt.INVALID_ARGUMENT,'Invalid path ('+e+'). Paths must not contain // in them.');return new o(e.split('/').filter(function(e){return 0e?t=t.left:0n?t=t.left:0n?e=e.left:(t+=e.left.size+1,e=e.right)}return-1},o.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(o.prototype,'size',{get:function(){return this.root.size},enumerable:!0,configurable:!0}),o.prototype.minKey=function(){return this.root.minKey()},o.prototype.maxKey=function(){return this.root.maxKey()},o.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},o.prototype.forEach=function(o){this.inorderTraversal(function(t,e){return o(t,e),!1})},o.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},o.prototype.getIterator=function(e){return new he(this.root,null,this.comparator,!1,e)},o.prototype.getIteratorFrom=function(n,t){return new he(this.root,n,this.comparator,!1,t)},o.prototype.getReverseIterator=function(e){return new he(this.root,null,this.comparator,!0,e)},o.prototype.getReverseIteratorFrom=function(n,t){return new he(this.root,n,this.comparator,!0,t)},o}(),he=function(){function e(a,s,e,n,r){this.resultGenerator=r||null,this.isReverse=n,this.nodeStack=[];for(var o=1;!a.isEmpty();)if(o=s?e(a.key,s):1,n&&(o*=-1),0>o)a=this.isReverse?a.left:a.right;else{if(0===o){this.nodeStack.push(a);break}this.nodeStack.push(a),a=this.isReverse?a.right:a.left}}return e.prototype.getNext=function(){Ho(0r?n.copy(null,null,null,n.left.insert(a,t,e),null):0===r?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(a,t,e)),n.fixUp()},a.prototype.removeMin=function(){if(this.left.isEmpty())return a.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()},a.prototype.remove=function(t,e){var n=this,o;if(0>e(t,n.key))n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),0===e(t,n.key)){if(n.right.isEmpty())return a.EMPTY;o=n.right.min(),n=n.copy(o.key,o.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp()},a.prototype.isRed=function(){return this.color},a.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},a.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e},a.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e},a.prototype.rotateLeft=function(){var t=this.copy(null,null,a.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},a.prototype.rotateRight=function(){var t=this.copy(null,null,a.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},a.prototype.colorFlip=function(){var n=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,t)},a.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},a.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw Wo('Red node has red child('+this.key+','+this.value+')');if(this.right.isRed())throw Wo('Right child of ('+this.key+','+this.value+') is red');var e=this.left.check();if(e!==this.right.check())throw Wo('Black depths differ');return e+(this.isRed()?0:1)},a.EMPTY=null,a.RED=!0,a.BLACK=!1,a}(),fe=function(){function e(){this.size=0}return e.prototype.copy=function(){return this},e.prototype.insert=function(n,t){return new le(n,t)},e.prototype.remove=function(){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(){return!1},e.prototype.reverseTraversal=function(){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}();le.EMPTY=new fe;var de=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),ye;!function(e){e[e.NullValue=0]='NullValue',e[e.BooleanValue=1]='BooleanValue',e[e.NumberValue=2]='NumberValue',e[e.TimestampValue=3]='TimestampValue',e[e.StringValue=4]='StringValue',e[e.BlobValue=5]='BlobValue',e[e.RefValue=6]='RefValue',e[e.GeoPointValue=7]='GeoPointValue',e[e.ArrayValue=8]='ArrayValue',e[e.ObjectValue=9]='ObjectValue'}(ye||(ye={}));var pe=function(){function e(){}return e.prototype.toString=function(){var e=this.value();return null===e?'null':''+e},e.prototype.defaultCompareTo=function(e){return Ho(this.typeOrder!==e.typeOrder,'Default compareTo should not be used for values of same type.'),P(this.typeOrder,e.typeOrder)},e}(),ge=function(n){function o(){var t=n.call(this)||this;return t.typeOrder=ye.NullValue,t.internalValue=null,t}return de(o,n),o.prototype.value=function(){return null},o.prototype.equals=function(e){return e instanceof o},o.prototype.compareTo=function(e){return e instanceof o?0:this.defaultCompareTo(e)},o.INSTANCE=new o,o}(pe),ve=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.BooleanValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue===e.internalValue},n.prototype.compareTo=function(e){return e instanceof n?P(this,e):this.defaultCompareTo(e)},n.of=function(e){return e?n.TRUE:n.FALSE},n.TRUE=new n(!0),n.FALSE=new n(!1),n}(pe),be=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.NumberValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.compareTo=function(e){return e instanceof n?B(this.internalValue,e.internalValue):this.defaultCompareTo(e)},n}(pe),we=function(n){function o(t){return n.call(this,t)||this}return de(o,n),o.prototype.equals=function(e){return e instanceof o&&U(this.internalValue,e.internalValue)},o}(be),Ie=function(o){function n(t){var r=o.call(this,t)||this;return r.internalValue=t,r}return de(n,o),n.prototype.equals=function(e){return e instanceof n&&U(this.internalValue,e.internalValue)},n.NAN=new n(NaN),n.POSITIVE_INFINITY=new n(1/0),n.NEGATIVE_INFINITY=new n(-1/0),n}(be),Te=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.StringValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue===e.internalValue},n.prototype.compareTo=function(e){return e instanceof n?P(this.internalValue,e.internalValue):this.defaultCompareTo(e)},n}(pe),Ee=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.TimestampValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue.toDate()},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.equals(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.compareTo(e.internalValue):e instanceof Se?-1:this.defaultCompareTo(e)},n}(pe),Se=function(o){function n(t){var r=o.call(this)||this;return r.localWriteTime=t,r.typeOrder=ye.TimestampValue,r}return de(n,o),n.prototype.value=function(){return null},n.prototype.equals=function(e){return e instanceof n&&this.localWriteTime.equals(e.localWriteTime)},n.prototype.compareTo=function(e){return e instanceof n?this.localWriteTime.compareTo(e.localWriteTime):e instanceof Ee?1:this.defaultCompareTo(e)},n.prototype.toString=function(){return''},n}(pe),Ce=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.BlobValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.n(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.r(e.internalValue):this.defaultCompareTo(e)},n}(pe),De=function(o){function r(t,a){var n=o.call(this)||this;return n.databaseId=t,n.key=a,n.typeOrder=ye.RefValue,n}return de(r,o),r.prototype.value=function(){return this.key},r.prototype.equals=function(e){return e instanceof r&&this.key.equals(e.key)&&this.databaseId.equals(e.databaseId)},r.prototype.compareTo=function(e){if(e instanceof r){var t=this.databaseId.compareTo(e.databaseId);return 0===t?ae.comparator(this.key,e.key):t}return this.defaultCompareTo(e)},r}(pe),ke=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.GeoPointValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.n(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.r(e.internalValue):this.defaultCompareTo(e)},n}(pe),Ne=function(o){function s(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.ObjectValue,r}return de(s,o),s.prototype.value=function(){var o={};return this.internalValue.inorderTraversal(function(t,e){o[t]=e.value()}),o},s.prototype.forEach=function(e){this.internalValue.inorderTraversal(e)},s.prototype.equals=function(e){if(e instanceof s){for(var t=this.internalValue.getIterator(),n=e.internalValue.getIterator();t.hasNext()&&n.hasNext();){var r=t.getNext(),o=n.getNext();if(r.key!==o.key||!r.value.equals(o.value))return!1}return!t.hasNext()&&!n.hasNext()}return!1},s.prototype.compareTo=function(e){if(e instanceof s){for(var t=this.internalValue.getIterator(),n=e.internalValue.getIterator();t.hasNext()&&n.hasNext();){var r=t.getNext(),o=n.getNext(),i=P(r.key,o.key)||r.value.compareTo(o.value);if(i)return i}return P(t.hasNext(),n.hasNext())}return this.defaultCompareTo(e)},s.prototype.set=function(e,t){if(Ho(!e.isEmpty(),'Cannot set field for empty path on ObjectValue'),1===e.length)return this.setChild(e.firstSegment(),t);var n=this.child(e.firstSegment());n instanceof s||(n=s.EMPTY);var r=n.set(e.popFirst(),t);return this.setChild(e.firstSegment(),r)},s.prototype.delete=function(e){if(Ho(!e.isEmpty(),'Cannot delete field for empty path on ObjectValue'),1===e.length)return new s(this.internalValue.remove(e.firstSegment()));var t=this.child(e.firstSegment());if(t instanceof s){var n=t.delete(e.popFirst());return new s(this.internalValue.insert(e.firstSegment(),n))}return this},s.prototype.contains=function(e){return void 0!==this.field(e)},s.prototype.field=function(e){Ho(!e.isEmpty(),'Can\'t get field of empty path');var o=this;return e.forEach(function(e){o=o instanceof s?o.internalValue.get(e)||void 0:void 0}),o},s.prototype.toString=function(){return JSON.stringify(this.value())},s.prototype.child=function(e){return this.internalValue.get(e)||void 0},s.prototype.setChild=function(e,t){return new s(this.internalValue.insert(e,t))},s.EMPTY=new s(new ce(P)),s}(pe),Ae=function(o){function a(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.ArrayValue,r}return de(a,o),a.prototype.value=function(){return this.internalValue.map(function(e){return e.value()})},a.prototype.forEach=function(e){this.internalValue.forEach(e)},a.prototype.equals=function(e){if(e instanceof a){if(this.internalValue.length!==e.internalValue.length)return!1;for(var t=0;t='===t?n.GREATER_THAN_OR_EQUAL:'>'===t?n.GREATER_THAN:Wo('Unknown relation: '+t)},n.prototype.toString=function(){return this.name},n.prototype.equals=function(e){return this.name===e.name},n.LESS_THAN=new n('<'),n.LESS_THAN_OR_EQUAL=new n('<='),n.EQUAL=new n('=='),n.GREATER_THAN=new n('>'),n.GREATER_THAN_OR_EQUAL=new n('>='),n}(),xe=function(){function n(o,r,e){this.field=o,this.op=r,this.value=e}return n.prototype.matches=function(o){if(this.field.isKeyField()){Ho(this.value instanceof De,'Comparing on key, but filter value not a RefValue');var t=this.value,e=ae.comparator(o.key,t.key);return this.matchesComparison(e)}var n=o.field(this.field);return void 0!==n&&this.matchesValue(n)},n.prototype.matchesValue=function(e){return this.value.typeOrder===e.typeOrder&&this.matchesComparison(e.compareTo(this.value))},n.prototype.matchesComparison=function(e){switch(this.op){case Le.LESS_THAN:return 0>e;case Le.LESS_THAN_OR_EQUAL:return 0>=e;case Le.EQUAL:return 0===e;case Le.GREATER_THAN:return 0=e:0>e},e.prototype.equals=function(o){if(null===o)return!1;if(this.before!==o.before||this.position.length!==o.position.length)return!1;for(var t=0;to,'timestamp nanoseconds out of range'+o),Ho(-62135596800<=n,'timestamp seconds out of range: '+n),Ho(253402300800>n,'timestamp seconds out of range'+n)}return a.now=function(){return a.fromEpochMilliseconds(Date.now())},a.fromDate=function(t){return a.fromEpochMilliseconds(t.getTime())},a.fromEpochMilliseconds=function(t){var e=Ut(t/1e3);return new a(e,1e6*(t-1e3*e))},a.fromISOString=function(t){var e=0,n=Ke.exec(t);if(Ho(!!n,'invalid timestamp: '+t),n[1]){var s=n[1];s=(s+'000000000').substr(0,9),e=parseInt(s,10)}var o=new Date(t);return new a(Ut(o.getTime()/1e3),e)},a.prototype.toDate=function(){return new Date(this.toEpochMilliseconds())},a.prototype.toEpochMilliseconds=function(){return 1e3*this.seconds+this.nanos/1e6},a.prototype.compareTo=function(e){return this.seconds===e.seconds?P(this.nanos,e.nanos):P(this.seconds,e.seconds)},a.prototype.equals=function(e){return e.seconds===this.seconds&&e.nanos===this.nanos},a.prototype.toString=function(){return'Timestamp(seconds='+this.seconds+', nanos='+this.nanos+')'},a}(),Ge=function(){function o(e){this.timestamp=e}return o.fromMicroseconds=function(t){var e=Ut(t/1e6);return new o(new We(e,1e3*(t%1e6)))},o.fromTimestamp=function(t){return new o(t)},o.forDeletedDoc=function(){return o.MIN},o.prototype.compareTo=function(e){return this.timestamp.compareTo(e.timestamp)},o.prototype.equals=function(e){return this.timestamp.equals(e.timestamp)},o.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanos/1e3},o.prototype.toString=function(){return'SnapshotVersion('+this.timestamp+')'},o.prototype.toTimestamp=function(){return this.timestamp},o.MIN=new o(new We(0,0)),o}(),He;!function(e){e[e.Listen=0]='Listen',e[e.ExistenceFilterMismatch=1]='ExistenceFilterMismatch',e[e.LimboResolution=2]='LimboResolution'}(He||(He={}));var me=function(){function n(a,s,e,n,r){void 0===n&&(n=Ge.MIN),void 0===r&&(r=i()),this.query=a,this.targetId=s,this.purpose=e,this.snapshotVersion=n,this.resumeToken=r}return n.prototype.update=function(t){return new n(this.query,this.targetId,this.purpose,t.snapshotVersion,t.resumeToken)},n.prototype.equals=function(e){return this.targetId===e.targetId&&this.purpose===e.purpose&&this.snapshotVersion.equals(e.snapshotVersion)&&this.resumeToken===e.resumeToken&&this.query.equals(e.query)},n}(),Xe=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ye=function(){function e(e){this.fields=e}return e.prototype.equals=function(e){return x(this.fields,e.fields)},e}(),Je=function(){function n(){}return n.prototype.equals=function(t){return t instanceof n},n.instance=new n,n}(),$e=function(){function e(n,o){this.field=n,this.transform=o}return e.prototype.equals=function(e){return this.field.equals(e.field)&&this.transform.equals(e.transform)},e}(),Ze=function(){function e(n,o){this.version=n,this.transformResults=o}return e}(),tn;!function(e){e[e.Set=0]='Set',e[e.Patch=1]='Patch',e[e.Transform=2]='Transform',e[e.Delete=3]='Delete'}(tn||(tn={}));var ze=function(){function n(n,o){this.updateTime=n,this.exists=o,Ho(void 0===n||void 0===o,'Precondition can specify "exists" or "updateTime" but not both')}return n.exists=function(t){return new n(void 0,t)},n.updateTime=function(t){return new n(t)},Object.defineProperty(n.prototype,'isNone',{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),n.prototype.isValidFor=function(e){return void 0===this.updateTime?void 0===this.exists?(Ho(this.isNone,'Precondition should be empty'),!0):this.exists?e instanceof se:null===e||e instanceof ue:e instanceof se&&e.version.equals(this.updateTime)},n.prototype.equals=function(e){return L(this.updateTime,e.updateTime)&&this.exists===e.exists},n.NONE=new n,n}(),nn=function(){function e(){}return e.prototype.verifyKeyMatches=function(e){null!=e&&Ho(e.key.equals(this.key),'Can only apply a mutation to a document with the same key')},e.getPostMutationVersion=function(e){return e instanceof se?e.version:Ge.MIN},e}(),rn=function(a){function n(t,i,n){var r=a.call(this)||this;return r.key=t,r.value=i,r.precondition=n,r.type=tn.Set,r}return Xe(n,a),n.prototype.applyToRemoteDocument=function(o,t){this.verifyKeyMatches(o),Ho(null==t.transformResults,'Transform results received by SetMutation.');var e=nn.getPostMutationVersion(o);return new se(this.key,e,this.value,{hasLocalMutations:!1})},n.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=nn.getPostMutationVersion(e);return new se(this.key,t,this.value,{hasLocalMutations:!0})},n.prototype.equals=function(e){return e instanceof n&&this.key.equals(e.key)&&this.value.equals(e.value)&&this.precondition.equals(e.precondition)},n}(nn),on=function(a){function n(t,s,n,r){var o=a.call(this)||this;return o.key=t,o.data=s,o.fieldMask=n,o.precondition=r,o.type=tn.Patch,o}return Xe(n,a),n.prototype.applyToRemoteDocument=function(o,t){if(this.verifyKeyMatches(o),Ho(null==t.transformResults,'Transform results received by PatchMutation.'),!this.precondition.isValidFor(o))return o;var e=nn.getPostMutationVersion(o),n=this.patchDocument(o);return new se(this.key,e,n,{hasLocalMutations:!1})},n.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=nn.getPostMutationVersion(e),n=this.patchDocument(e);return new se(this.key,t,n,{hasLocalMutations:!0})},n.prototype.equals=function(e){return e instanceof n&&this.key.equals(e.key)&&this.fieldMask.equals(e.fieldMask)&&this.precondition.equals(e.precondition)},n.prototype.patchDocument=function(n){var t;return t=n instanceof se?n.data:Ne.EMPTY,this.patchObject(t)},n.prototype.patchObject=function(a){for(var t=0,e=this.fieldMask.fields;t>Jn<=o?e|this.generatorId:(e|this.generatorId)-(1<',o),e=this.store.put(o)):(So('SimpleDb','PUT',this.store.name,o,t),e=this.store.put(t,o)),ct(e)},e.prototype.get=function(o){var t=this;return ct(this.store.get(o)).next(function(e){return void 0===e&&(e=null),So('SimpleDb','GET',t.store.name,o,e),e})},e.prototype.delete=function(e){return So('SimpleDb','DELETE',this.store.name,e),ct(this.store.delete(e))},e.prototype.loadAll=function(o,t){var e=this.cursor(this.options(o,t)),n=[];return this.iterateCursor(e,function(o,t){n.push(t)}).next(function(){return n})},e.prototype.deleteAll=function(o,t){So('SimpleDb','DELETE ALL',this.store.name);var e=this.options(o,t);e.keysOnly=!1;var n=this.cursor(e);return this.iterateCursor(n,function(o,t,e){return e.delete()})},e.prototype.iterate=function(o,t){var e;t?e=o:(e={},t=o);var n=this.cursor(e);return this.iterateCursor(n,t)},e.prototype.iterateCursor=function(a,s){var e=[];return new Gn(function(n,r){a.onerror=function(e){r(e.target.error)},a.onsuccess=function(r){var t=r.target.result;if(!t)return void n();var d=new Sr(t),i=s(t.primaryKey,t.value,d);i instanceof Gn&&e.push(i),d.isDone?n():null===d.skipToKey?t.continue():t.continue(d.skipToKey)}}).next(function(){return Gn.waitFor(e)})},e.prototype.options=function(o,r){var a;return void 0!==o&&('string'==typeof o?a=o:(Ho(void 0===r,'3rd argument must not be defined if 2nd is a range.'),r=o)),{index:a,range:r}},e.prototype.cursor=function(o){var t='next';if(o.reverse&&(t='prev'),o.index){var e=this.store.index(o.index);return o.keysOnly?e.openKeyCursor(o.range,t):e.openCursor(o.range,t)}return this.store.openCursor(o.range,t)},e}(),kr=function(){function o(n,o){this.userId=n,this.serializer=o,this.garbageCollector=null}return o.forUser=function(t,e){return Ho(''!==t.uid,'UserID must not be an empty string.'),new o(t.isUnauthenticated()?'':t.uid,e)},o.prototype.start=function(r){var e=this;return o.loadNextBatchIdFromDb(r).next(function(n){return e.nextBatchId=n,ht(r).get(e.userId)}).next(function(n){return n||(n=new pr(e.userId,nr,'')),e.metadata=n,e.metadata.lastAcknowledgedBatchId>=e.nextBatchId?e.checkEmpty(r).next(function(n){return Ho(n,'Reset nextBatchID is only possible when the queue is empty'),e.metadata.lastAcknowledgedBatchId=nr,ht(r).put(e.metadata)}):Gn.resolve()})},o.loadNextBatchIdFromDb=function(n){var a=nr;return pt(n).iterate({reverse:!0},function(e,t,n){var r=e[0];if(e[1]>a&&(a=t.batchId),''===r)n.done();else{var o=D(r);n.skip([o])}}).next(function(){return a+1})},o.prototype.checkEmpty=function(o){var a=!0,e=IDBKeyRange.bound(this.keyForBatchId(Number.NEGATIVE_INFINITY),this.keyForBatchId(Number.POSITIVE_INFINITY));return pt(o).iterate({range:e},function(e,t,n){a=!1,n.done()}).next(function(){return a})},o.prototype.getNextBatchId=function(){return Gn.resolve(this.nextBatchId)},o.prototype.getHighestAcknowledgedBatchId=function(){return Gn.resolve(this.metadata.lastAcknowledgedBatchId)},o.prototype.acknowledgeBatch=function(o,t,e){var n=t.batchId;return Ho(n>this.metadata.lastAcknowledgedBatchId,'Mutation batchIDs must be acknowledged in order'),this.metadata.lastAcknowledgedBatchId=n,this.metadata.lastStreamToken=dt(e),ht(o).put(this.metadata)},o.prototype.getLastStreamToken=function(){return Gn.resolve(this.metadata.lastStreamToken)},o.prototype.setLastStreamToken=function(n,t){return this.metadata.lastStreamToken=dt(t),ht(n).put(this.metadata)},o.prototype.addMutationBatch=function(d,t,e){var n=this,r=this.nextBatchId;this.nextBatchId++;var o=new or(r,t,e),i=this.serializer.toDbMutationBatch(this.userId,o);return pt(d).put(i).next(function(){for(var t=[],o=0,i=e;os,'Should have found mutation after '+s),n=e.serializer.fromDbMutationBatch(t)),r.done()}).next(function(){return n})},o.prototype.getAllMutationBatches=function(o){var r=this,e=IDBKeyRange.bound(this.keyForBatchId(nr),this.keyForBatchId(Number.POSITIVE_INFINITY));return pt(o).loadAll(e).next(function(e){return e.map(function(e){return r.serializer.fromDbMutationBatch(e)})})},o.prototype.getAllMutationBatchesThroughBatchId=function(o,t){var e=this,n=IDBKeyRange.bound(this.keyForBatchId(nr),this.keyForBatchId(t));return pt(o).loadAll(n).next(function(n){return n.map(function(n){return e.serializer.fromDbMutationBatch(n)})})},o.prototype.getAllMutationBatchesAffectingDocumentKey=function(d,t){var e=this,n=hr.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(n),a=[];return ut(d).iterate({range:r},function(n,r,o){var i=n[0],s=n[1],p=n[2],c=st(s);if(i!==e.userId||!t.path.equals(c))return void o.done();var l=e.keyForBatchId(p);return pt(d).get(l).next(function(o){null===o&&Wo('Dangling document-mutation reference found: '+n+' which points to '+l),a.push(e.serializer.fromDbMutationBatch(o))})}).next(function(){return a})},o.prototype.getAllMutationBatchesAffectingQuery=function(d,t){var l=this;Ho(!t.isDocumentQuery(),'Document queries shouldn\'t go down this path');var n=t.path,r=n.length+1,e=hr.prefixForPath(this.userId,n),o=(e[1],IDBKeyRange.lowerBound(e)),p=new en(P);return ut(d).iterate({range:o},function(o,t,e){var i=o[0],a=o[1],s=o[2],d=st(a);return i===l.userId&&n.isPrefixOf(d)?void(d.length===r&&(p=p.add(s))):void e.done()}).next(function(){var n=[],e=[];return p.forEach(function(t){var o=l.keyForBatchId(t);e.push(pt(d).get(o).next(function(e){null===e&&Wo('Dangling document-mutation reference found, which points to '+o),n.push(l.serializer.fromDbMutationBatch(e))}))}),Gn.waitFor(e).next(function(){return n})})},o.prototype.removeMutationBatches=function(d,t){for(var p=pt(d),e=ut(d),n=[],o=this,r=0,a=t,i;rthis.metadata.highestTargetId?(this.metadata.highestTargetId=n,r.next(function(){return ft(a).put(br.key,e.metadata)})):r},e.prototype.removeQueryData=function(n,t){return this.removeMatchingKeysForTargetId(n,t.targetId).next(function(){gt(n).delete(t.targetId)})},e.prototype.getQueryData=function(a,s){var e=this,t=s.canonicalId(),n=IDBKeyRange.bound([t,Number.NEGATIVE_INFINITY],[t,Ft]),d=null;return gt(a).iterate({range:n,index:fr.queryTargetsIndexName},function(n,t,r){var o=e.serializer.fromDbTarget(t);s.equals(o.query)&&(d=o,r.done())}).next(function(){return d})},e.prototype.addMatchingKeys=function(a,t,i){var n=[],r=yt(a);return t.forEach(function(o){var t=rt(o.path);n.push(r.put(new yr(i,t)))}),Gn.waitFor(n)},e.prototype.removeMatchingKeys=function(a,t,s){var n=this,r=[],o=yt(a);return t.forEach(function(a){var t=rt(a.path);r.push(o.delete([s,t])),null!==n.garbageCollector&&n.garbageCollector.addPotentialGarbageKey(a)}),Gn.waitFor(r)},e.prototype.removeMatchingKeysForTargetId=function(o,t){var e=yt(o),n=IDBKeyRange.bound([t],[t+1],!1,!0);return this.notifyGCForRemovedKeys(o,n).next(function(){return e.delete(n)})},e.prototype.notifyGCForRemovedKeys=function(o,t){var a=this,n=yt(o);return null!==this.garbageCollector&&this.garbageCollector.isEager?n.iterate({range:t,keysOnly:!0},function(e){var t=st(e[1]),n=new ae(t);Ho(null!==a.garbageCollector,'GarbageCollector for query cache set to null during key removal.'),a.garbageCollector.addPotentialGarbageKey(n)}):Gn.resolve()},e.prototype.getMatchingKeysForTargetId=function(a,t){var e=IDBKeyRange.bound([t],[t+1],!1,!0),i=yt(a),s=J();return i.iterate({range:e,keysOnly:!0},function(e){var t=st(e[1]),n=new ae(t);s=s.add(n)}).next(function(){return s})},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(a,t){Ho(null!==a,'Persistence Transaction cannot be null for query cache containsKey');var e=rt(t.path),n=IDBKeyRange.bound([e],[_(e)],!1,!0),i=0;return yt(a).iterate({index:yr.documentTargetsIndex,keysOnly:!0,range:n},function(o,t,e){i++,e.done()}).next(function(){return 0t?(o('Persistence owner-lease is in the future. Discarding.',n),1):n.ownerId===this.getZombiedOwnerId()))},r.prototype.scheduleOwnerLeaseRefreshes=function(){var n=this;this.ownerLeaseRefreshHandle=setInterval(function(){n.runTransaction('Refresh owner timestamp',function(t){return t.store(dr.store).put('owner',new dr(n.ownerId,Date.now()))}).catch(function(t){o(t),n.stopOwnerLeaseRefreshes()})},4e3)},r.prototype.stopOwnerLeaseRefreshes=function(){this.ownerLeaseRefreshHandle&&(clearInterval(this.ownerLeaseRefreshHandle),this.ownerLeaseRefreshHandle=null)},r.prototype.attachWindowUnloadHook=function(){var e=this;this.windowUnloadHandler=function(){e.setZombiedOwnerId(e.ownerId),e.shutdown()},window.addEventListener('unload',this.windowUnloadHandler)},r.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(window.removeEventListener('unload',this.windowUnloadHandler),this.windowUnloadHandler=null)},r.prototype.getZombiedOwnerId=function(){try{var e=window.localStorage.getItem(this.zombiedOwnerLocalStorageKey());return So('IndexedDbPersistence','Zombied ownerID from LocalStorage:',e),e}catch(e){return o('Failed to get zombie owner id.',e),null}},r.prototype.setZombiedOwnerId=function(e){try{null===e?window.localStorage.removeItem(this.zombiedOwnerLocalStorageKey()):window.localStorage.setItem(this.zombiedOwnerLocalStorageKey(),e)}catch(e){o('Failed to set zombie owner id.',e)}},r.prototype.zombiedOwnerLocalStorageKey=function(){return this.localStoragePrefix+'zombiedOwnerId'},r.prototype.generateOwnerId=function(){return zt.newId()},r.MAIN_DATABASE='main',r}(),Or=function(){function e(n,o){this.remoteDocumentCache=n,this.mutationQueue=o}return e.prototype.getDocument=function(o,t){var e=this;return this.remoteDocumentCache.getEntry(o,t).next(function(n){return e.computeLocalDocument(o,t,n)})},e.prototype.getDocuments=function(a,t){var i=this,n=[],r=X();return t.forEach(function(o){n.push(i.getDocument(a,o).next(function(e){e||(e=new ue(o,Ge.forDeletedDoc())),r=r.insert(o,e)}))}),Gn.waitFor(n).next(function(){return r})},e.prototype.getDocumentsMatchingQuery=function(n,t){return ae.isDocumentKey(t.path)?this.getDocumentsMatchingDocumentQuery(n,t.path):this.getDocumentsMatchingCollectionQuery(n,t)},e.prototype.getDocumentsMatchingDocumentQuery=function(n,t){return this.getDocument(n,new ae(t)).next(function(n){var t=Q();return n instanceof se&&(t=t.insert(n.key,n)),t})},e.prototype.getDocumentsMatchingCollectionQuery=function(a,i){var t=this,e;return this.remoteDocumentCache.getDocumentsMatchingQuery(a,i).next(function(n){return t.computeLocalDocuments(a,n)}).next(function(n){return e=n,t.mutationQueue.getAllMutationBatchesAffectingQuery(a,i)}).next(function(n){for(var r=J(),o=0,i=n;on,'Acknowledged batches can\'t be rejected.'),t})}).next(function(){return i.removeMutationBatch(e,t)}).next(function(o){return n=o,i.mutationQueue.performConsistencyCheck(e)}).next(function(){return i.localDocuments.getDocuments(e,n)})})},e.prototype.getLastStreamToken=function(){var n=this;return this.persistence.runTransaction('Get last stream token',function(t){return n.mutationQueue.getLastStreamToken(t)})},e.prototype.setLastStreamToken=function(o){var t=this;return this.persistence.runTransaction('Set last stream token',function(e){return t.mutationQueue.setLastStreamToken(e,o)})},e.prototype.getLastRemoteSnapshotVersion=function(){return this.queryCache.getLastRemoteSnapshotVersion()},e.prototype.applyRemoteEvent=function(i){var p=this,e=new Pr(this.remoteDocuments);return this.persistence.runTransaction('Apply remote event',function(c){var r=[];d(i.targetChanges,function(e,t){var n=p.targetIds[e];if(n){var o=t.mapping;if(o)if(o instanceof vn)r.push(p.queryCache.removeMatchingKeysForTargetId(c,e).next(function(){return p.queryCache.addMatchingKeys(c,o.documents,e)}));else{if(!(o instanceof bn))return Wo('Unknown mapping type: '+JSON.stringify(o));r.push(p.queryCache.removeMatchingKeys(c,o.removedDocuments,e).next(function(){return p.queryCache.addMatchingKeys(c,o.addedDocuments,e)}))}var a=t.resumeToken;0=n.compareTo(t)||u(this.targetIds)},e.prototype.shouldHoldBatchResult=function(e){return!this.isRemoteUpToVersion(e)||0r.version.compareTo(l))&&(r=n.applyToRemoteDocument(d,r,s),r?e.addEntry(r):Ho(!o,'Mutation batch '+n+' applied to document '+o+' resulted in null'))})}),r},e}(),xr=function(){function e(){this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=nr,this.lastStreamToken=i(),this.garbageCollector=null,this.batchesByDocumentKey=new en(Yn.compareByKey)}return e.prototype.start=function(){return 0===this.mutationQueue.length&&(this.nextBatchId=1,this.highestAcknowledgedBatchId=nr),Ho(this.highestAcknowledgedBatchIdthis.highestAcknowledgedBatchId,'Mutation batchIDs must be acknowledged in order');var r=this.indexOfExistingBatchId(n,'acknowledged'),o=this.mutationQueue[r];return Ho(n===o.batchId,'Queue ordering failure: expected batch '+n+', got batch '+o.batchId),Ho(!o.isTombstone(),'Can\'t acknowledge a previously removed batch'),this.highestAcknowledgedBatchId=n,this.lastStreamToken=e,Gn.resolve()},e.prototype.getLastStreamToken=function(){return Gn.resolve(this.lastStreamToken)},e.prototype.setLastStreamToken=function(n,t){return this.lastStreamToken=t,Gn.resolve()},e.prototype.addMutationBatch=function(d,t,e){Ho(0!==e.length,'Mutation batches should not be empty');var n=this.nextBatchId;this.nextBatchId++,0n?0:n,o;rn?n=0:n>=e?n=e:n++,Gn.resolve(this.getAllLiveMutationBatchesBeforeIndex(n))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(a,s){var e=this,t=new Yn(s,0),n=new Yn(s,Ft),o=[];return this.batchesByDocumentKey.forEachInRange([t,n],function(n){Ho(s.equals(n.key),'Should only iterate over a single key\'s batches');var t=e.findMutationBatch(n.targetOrBatchId);Ho(null!==t,'Batches in the index must exist in the main table'),o.push(t)}),Gn.resolve(o)},e.prototype.getAllMutationBatchesAffectingQuery=function(d,t){var l=this,n=t.path,r=n.length+1,e=n;ae.isDocumentKey(e)||(e=e.child(''));var o=new Yn(new ae(e),0),a=new en(P);this.batchesByDocumentKey.forEachWhile(function(o){var t=o.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(o.targetOrBatchId)),!0)},o);var i=[];return a.forEach(function(n){var t=l.findMutationBatch(n);null!==t&&i.push(t)}),Gn.resolve(i)},e.prototype.removeMutationBatches=function(c,t){var e=t.length;Ho(0t||t>=this.mutationQueue.length)return null;var e=this.mutationQueue[t];return Ho(e.batchId===o,'If found batch must match'),e.isTombstone()?null:e},e}(),Dr=function(){function e(){this.queries=new jn(function(e){return e.canonicalId()}),this.lastRemoteSnapshotVersion=Ge.MIN,this.highestTargetId=0,this.references=new Xn}return e.prototype.start=function(){return Gn.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},e.prototype.getHighestTargetId=function(){return this.highestTargetId},e.prototype.setLastRemoteSnapshotVersion=function(n,t){return this.lastRemoteSnapshotVersion=t,Gn.resolve()},e.prototype.addQueryData=function(o,t){this.queries.set(t.query,t);var e=t.targetId;return e>this.highestTargetId&&(this.highestTargetId=e),Gn.resolve()},e.prototype.removeQueryData=function(n,t){return this.queries.delete(t.query),this.references.removeReferencesForId(t.targetId),Gn.resolve()},e.prototype.getQueryData=function(o,t){var e=this.queries.get(t)||null;return Gn.resolve(e)},e.prototype.addMatchingKeys=function(o,t,e){return this.references.addReferences(t,e),Gn.resolve()},e.prototype.removeMatchingKeys=function(o,t,e){return this.references.removeReferences(t,e),Gn.resolve()},e.prototype.removeMatchingKeysForTargetId=function(n,t){return this.references.removeReferencesForId(t),Gn.resolve()},e.prototype.getMatchingKeysForTargetId=function(o,t){var e=this.references.referencesForId(t);return Gn.resolve(e)},e.prototype.setGarbageCollector=function(e){this.references.setGarbageCollector(e)},e.prototype.containsKey=function(n,t){return this.references.containsKey(n,t)},e}(),_r=function(){function e(){this.docs=X()}return e.prototype.addEntry=function(n,t){return this.docs=this.docs.insert(t.key,t),Gn.resolve()},e.prototype.removeEntry=function(n,t){return this.docs=this.docs.remove(t),Gn.resolve()},e.prototype.getEntry=function(n,t){return Gn.resolve(this.docs.get(t))},e.prototype.getDocumentsMatchingQuery=function(d,t){for(var e=Q(),n=new ae(t.path.child('')),r=this.docs.getIteratorFrom(n);r.hasNext();){var o=r.getNext(),i=o.key,a=o.value;if(!t.path.isPrefixOf(i.path))break;a instanceof se&&t.matches(a)&&(e=e.insert(a.key,a))}return Gn.resolve(e)},e}(),Mr=function(){function e(){this.mutationQueues={},this.remoteDocumentCache=new _r,this.queryCache=new Dr,this.started=!1}return e.prototype.start=function(){return Ho(!this.started,'MemoryPersistence double-started!'),this.started=!0,Promise.resolve()},e.prototype.shutdown=function(){return Ho(this.started,'MemoryPersistence shutdown without start!'),this.started=!1,Promise.resolve()},e.prototype.getMutationQueue=function(n){var t=this.mutationQueues[n.toKey()];return t||(t=new xr,this.mutationQueues[n.toKey()]=t),t},e.prototype.getQueryCache=function(){return this.queryCache},e.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},e.prototype.runTransaction=function(n,t){return So('MemoryPersistence','Starting transaction:',n),t(new Fr).toPromise()},e}(),Fr=function(){return function(){}}(),Br=function(){function e(){this.isEager=!1}return e.prototype.addGarbageSource=function(){},e.prototype.removeGarbageSource=function(){},e.prototype.addPotentialGarbageKey=function(){},e.prototype.collectGarbage=function(){return Gn.resolve(J())},e}(),Ur=function(){function e(){var o=this;this.promise=new Promise(function(t,e){o.resolve=t,o.reject=e})}return e}(),Vr=function(){function e(o,r,e){this.initialDelayMs=o,this.backoffFactor=r,this.maxDelayMs=e,this.reset()}return e.prototype.reset=function(){this.currentBaseMs=0},e.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},e.prototype.backoffAndWait=function(){var n=new Ur,t=this.currentBaseMs+this.jitterDelayMs();return 0this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs),n.promise},e.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},e}(),Hr=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wr;!function(e){e[e.Initial=0]='Initial',e[e.Auth=1]='Auth',e[e.Open=2]='Open',e[e.Error=3]='Error',e[e.Backoff=4]='Backoff',e[e.Stopped=5]='Stopped'}(Wr||(Wr={}));var Zn=function(){function e(o,a,e,n){this.queue=o,this.connection=a,this.credentialsProvider=e,this.idle=!1,this.stream=null,this.listener=null,this.backoff=new Vr(n||1e3,1.5,6e4),this.state=Wr.Initial}return e.prototype.isStarted=function(){return this.state===Wr.Backoff||this.state===Wr.Auth||this.state===Wr.Open},e.prototype.isOpen=function(){return this.state===Wr.Open},e.prototype.start=function(e){return this.state===Wr.Error?void this.performBackoff(e):void(Ho(this.state===Wr.Initial,'Already started'),this.listener=e,this.auth())},e.prototype.stop=function(){this.isStarted()&&this.close(Wr.Stopped)},e.prototype.inhibitBackoff=function(){Ho(!this.isStarted(),'Can only inhibit backoff in a stopped state'),this.state=Wr.Initial,this.backoff.reset()},e.prototype.markIdle=function(){var e=this;this.idle=!0,this.queue.schedule(function(){return e.handleIdleCloseTimer()},6e4).catch(function(e){Ho(e.code===Gt.CANCELLED,'Received unexpected error in idle timeout closure. Expected CANCELLED, but was: '+e)})},e.prototype.sendRequest=function(e){this.cancelIdleCheck(),this.stream.send(e)},e.prototype.handleIdleCloseTimer=function(){return this.isOpen()&&this.idle?this.close(Wr.Initial):Promise.resolve()},e.prototype.cancelIdleCheck=function(){this.idle=!1},e.prototype.close=function(r,t){Ho(r==Wr.Error||V(t),'Can\'t provide an error when not in an error state.'),this.cancelIdleCheck(),r==Wr.Error?t&&t.code===Gt.RESOURCE_EXHAUSTED&&(o(''+t),o('Using maximum backoff delay to prevent overloading the backend.'),this.backoff.resetToMax()):this.backoff.reset(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=r;var e=this.listener;return this.listener=null,r==Wr.Stopped?Promise.resolve():e.onClose(t)},e.prototype.tearDown=function(){},e.prototype.auth=function(){var o=this;Ho(this.state===Wr.Initial,'Must be in initial state to auth'),this.state=Wr.Auth,this.credentialsProvider.getToken(!1).then(function(t){o.startStream(t)},function(t){o.queue.schedule(function(){if(o.state!==Wr.Stopped){var e=new Ht(Gt.UNKNOWN,'Fetching auth token failed: '+t.message);return o.handleStreamClose(e)}return Promise.resolve()})})},e.prototype.startStream=function(o){var a=this;if(this.state!==Wr.Stopped){Ho(this.state===Wr.Auth,'Trying to start stream in a non-auth state');var e=function(e,t){a.queue.schedule(function(){return a.stream===e?t():Promise.resolve()})};if(null!==this.listener){var n=this.startRpc(o);this.stream=n,this.stream.onOpen(function(){e(n,function(){return Ho(a.state===Wr.Auth,'Expected stream to be in state auth, but was '+a.state),a.state=Wr.Open,a.listener.onOpen()})}),this.stream.onClose(function(o){e(n,function(){return a.handleStreamClose(o)})}),this.stream.onMessage(function(o){e(n,function(){return a.onMessage(o)})})}}},e.prototype.performBackoff=function(n){var t=this;Ho(this.state===Wr.Error,'Should only perform backoff in an error case'),this.state=Wr.Backoff,this.backoff.backoffAndWait().then(function(){t.queue.schedule(function(){return t.state===Wr.Stopped?Promise.resolve():(t.state=Wr.Initial,t.start(n),Ho(t.isStarted(),'PersistentStream should have started'),Promise.resolve())})})},e.prototype.handleStreamClose=function(e){return Ho(this.isStarted(),'Can\'t handle server close on non-started stream'),So('PersistentStream','close with error: '+e),this.stream=null,this.close(Wr.Error,e)},e}(),qr=function(d){function t(t,l,n,r,o,i){var a=d.call(this,l,n,r,i)||this;return a.databaseInfo=t,a.serializer=o,a}return Hr(t,d),t.prototype.startRpc=function(e){return this.connection.openStream('Listen',e)},t.prototype.onMessage=function(o){this.backoff.reset();var t=this.serializer.fromWatchChange(o),e=this.serializer.versionFromListenResponse(o);return this.listener.onWatchChange(t,e)},t.prototype.watch=function(o){var t={database:this.serializer.encodedDatabaseId,addTarget:this.serializer.toTarget(o)},e=this.serializer.toListenRequestLabels(o);e&&(t.labels=e),this.sendRequest(t)},t.prototype.unwatch=function(n){var t={};t.database=this.serializer.encodedDatabaseId,t.removeTarget=n,this.sendRequest(t)},t}(Zn),jr=function(d){function t(t,l,n,r,o,i){var a=d.call(this,l,n,r,i)||this;return a.databaseInfo=t,a.serializer=o,a.y=!1,a}return Hr(t,d),Object.defineProperty(t.prototype,'handshakeComplete',{get:function(){return this.y},enumerable:!0,configurable:!0}),t.prototype.start=function(t){this.y=!1,d.prototype.start.call(this,t)},t.prototype.tearDown=function(){this.y&&this.writeMutations([])},t.prototype.startRpc=function(e){return this.connection.openStream('Write',e)},t.prototype.onMessage=function(o){if(Ho(!!o.streamToken,'Got a write response without a stream token'),this.lastStreamToken=o.streamToken,this.y){this.backoff.reset();var t=this.serializer.fromWriteResults(o.writeResults),e=this.serializer.fromVersion(o.commitTime);return this.listener.onMutationResult(e,t)}return Ho(!o.writeResults||0===o.writeResults.length,'Got mutation results for handshake'),this.y=!0,this.listener.onHandshakeComplete()},t.prototype.writeHandshake=function(){Ho(this.isOpen(),'Writing handshake requires an opened stream'),Ho(!this.y,'Handshake already completed');var e={};e.database=this.serializer.encodedDatabaseId,this.sendRequest(e)},t.prototype.writeMutations=function(o){var r=this;Ho(this.isOpen(),'Writing mutations requires an opened stream'),Ho(this.y,'Handshake must be complete before writing mutations'),Ho(0this.pendingWrites.length},e.prototype.outstandingWrites=function(){return this.pendingWrites.length},e.prototype.commit=function(e){Ho(this.canWriteMutations(),'commit called when batches can\'t be written'),this.lastBatchSeen=e.batchId,this.pendingWrites.push(e),this.shouldStartWriteStream()?this.startWriteStream():this.isNetworkEnabled()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(e.mutations)},e.prototype.shouldStartWriteStream=function(){return this.isNetworkEnabled()&&!this.writeStream.isStarted()&&0t.indexOf('Firestore Test Simulated Error')&&setTimeout(function(){throw e},0),e}).then(function(){r.operationInProgress=!1})}),this.tail},e.prototype.verifyOperationInProgress=function(){Ho(this.operationInProgress,'verifyOpInProgress() called when no op in progress on this queue.')},e.prototype.drain=function(o){var t=this;return this.delayedOperations.forEach(function(e){e.handle&&(clearTimeout(e.handle),o?t.scheduleInternal(e.op).then(e.deferred.resolve,e.deferred.reject):e.deferred.reject(new Ht(Gt.CANCELLED,'Operation cancelled by shutdown')))}),this.delayedOperations=[],this.delayedOperationsCount=0,this.schedule(function(){return Promise.resolve()})},e}(),oo=function(){function e(e){this.uid=e}return e.prototype.isUnauthenticated=function(){return null==this.uid},e.prototype.toKey=function(){return this.isUnauthenticated()?'anonymous-user':'uid:'+this.uid},e.prototype.equals=function(e){return e.uid===this.uid},e.UNAUTHENTICATED=new e(null),e.GOOGLE_CREDENTIALS=new e('google-credentials-uid'),e.FIRST_PARTY=new e('first-party-uid'),e}(),io=function(){function e(n,o){this.user=o,this.type='OAuth',this.authHeaders={Authorization:'Bearer '+n}}return e}(),ao=function(){function e(){this.userListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.setUserChangeListener=function(e){Ho(!this.userListener,'Can only call setUserChangeListener() once.'),this.userListener=e,e(oo.UNAUTHENTICATED)},e.prototype.removeUserChangeListener=function(){Ho(null!==this.userListener,'removeUserChangeListener() when no listener registered'),this.userListener=null},e}(),so=function(){function e(n){var o=this;this.app=n,this.tokenListener=null,this.userCounter=0,this.userListener=null,this.tokenListener=function(){var e=o.getUser();o.currentUser&&e.equals(o.currentUser)||(o.currentUser=e,o.userCounter++,o.userListener&&o.userListener(o.currentUser))},this.userCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return e.prototype.getToken=function(o){var r=this;Ho(null!=this.tokenListener,'getToken cannot be called after listener removed.');var e=this.userCounter;return this.app.INTERNAL.getToken(o).then(function(n){if(r.userCounter!==e)throw new Ht(Gt.ABORTED,'getToken aborted due to uid change.');return n?(Ho('string'==typeof n.accessToken,'Invalid tokenData returned from getToken():'+n),new io(n.accessToken,r.currentUser)):null})},e.prototype.setUserChangeListener=function(e){Ho(!this.userListener,'Can only call setUserChangeListener() once.'),this.userListener=e,this.currentUser&&e(this.currentUser)},e.prototype.removeUserChangeListener=function(){Ho(null!=this.tokenListener,'removeUserChangeListener() called twice'),Ho(null!==this.userListener,'removeUserChangeListener() called when no listener registered'),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.userListener=null},e.prototype.getUser=function(){'function'!=typeof this.app.INTERNAL.getUid&&Wo('This version of the Firestore SDK requires at least version 3.7.0 of firebase.js.');var e=this.app.INTERNAL.getUid();return Ho(null===e||'string'==typeof e,'Received invalid UID: '+e),new oo(e)},e}(),uo=function(){function e(n,o){this.gapi=n,this.sessionIndex=o,this.type='FirstParty',this.user=oo.FIRST_PARTY,Ho(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,'unexpected gapi interface')}return Object.defineProperty(e.prototype,'authHeaders',{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),e}(),co=function(){function e(n,o){this.gapi=n,this.sessionIndex=o,Ho(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,'unexpected gapi interface')}return e.prototype.getToken=function(){return Promise.resolve(new uo(this.gapi,this.sessionIndex))},e.prototype.setUserChangeListener=function(e){e(oo.FIRST_PARTY)},e.prototype.removeUserChangeListener=function(){},e}(),ho=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),lo=function(){function e(){}return e.delete=function(){return fo.instance},e.serverTimestamp=function(){return po.instance},e}(),fo=function(n){function t(){return n.call(this)||this}return ho(t,n),t.instance=new t,t}(lo),po=function(n){function t(){return n.call(this)||this}return ho(t,n),t.instance=new t,t}(lo),yo=s(lo,'Use FieldValue.() instead.'),Xr=/^__.*__$/,go=function(){function e(o,r,e){this.data=o,this.fieldMask=r,this.fieldTransforms=e}return e.prototype.toMutations=function(o,t){var e=[];return null===this.fieldMask?e.push(new rn(o,this.data,t)):e.push(new on(o,this.data,this.fieldMask,t)),0=n.docs.size,'Too many documents returned on a document query');var t=n.docs.get(e.q);s.next(new Oo(e.firestore,e.q,t,n.fromCache))}},error:t}),o=this._.listen(Pe.atPath(this.q.path),n,a);return function(){n.mute(),e._.unlisten(o)}},o.prototype.get=function(){var o=this;return m('DocumentReference.get',arguments,0),new Promise(function(a,e){var i=o.onSnapshotInternal({includeQueryMetadataChanges:!0,includeDocumentMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(n){i(),!n.exists&&n.metadata.fromCache?e(new Ht(Gt.ABORTED,'Failed to get document because the client is offline.')):a(n)},error:e})})},o}(),Oo=function(){function e(o,a,e,n){this.Q=o,this.q=a,this.nt=e,this.rt=n}return e.prototype.data=function(){if(m('DocumentSnapshot.data',arguments,0),!this.nt)throw new Ht(Gt.NOT_FOUND,'This document doesn\'t exist. Check doc.exists to make sure the document exists before calling doc.data().');return this.convertObject(this.nt.data)},e.prototype.get=function(n){if(m('DocumentSnapshot.get',arguments,1),!this.nt)throw new Ht(Gt.NOT_FOUND,'This document doesn\'t exist. Check doc.exists to make sure the document exists before calling doc.get().');var t=this.nt.data.field(At('DocumentSnapshot.get',n));return void 0===t?void 0:this.convertValue(t)},Object.defineProperty(e.prototype,'id',{get:function(){return this.q.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'ref',{get:function(){return new Ro(this.q,this.Q)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'exists',{get:function(){return null!==this.nt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'metadata',{get:function(){return{hasPendingWrites:null!==this.nt&&this.nt.hasLocalMutations,fromCache:this.rt}},enumerable:!0,configurable:!0}),e.prototype.convertObject=function(o){var a=this,e={};return o.forEach(function(n,t){e[n]=a.convertValue(t)}),e},e.prototype.convertValue=function(r){if(r instanceof Ne)return this.convertObject(r);if(r instanceof Ae)return this.convertArray(r);if(r instanceof De){var t=r.value(),e=this.Q.ensureClientConfigured().databaseId();return r.databaseId.equals(e)||o('Document '+this.q.path+' contains a document reference within a different database ('+r.databaseId.projectId+'/'+r.databaseId.database+') which is not supported. It will be treated as a reference in the current database ('+e.projectId+'/'+e.database+') instead.'),new Ro(t,this.Q)}return r.value()},e.prototype.convertArray=function(n){var o=this;return n.internalValue.map(function(e){return o.convertValue(e)})},e}(),Mo=function(){function s(n,o){this.ot=n,this.firestore=o}return s.prototype.where=function(t,e,n){m('Query.where',arguments,3),b('Query.where','string',2,e),I('Query.where',3,n);var d=At('Query.where',t),i;if(!d.isKeyField())i=this.firestore._dataConverter.parseQueryValue('Query.where',n);else if('string'==typeof n){if(-1!==n.indexOf('/'))throw new Ht(Gt.INVALID_ARGUMENT,'Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.');if(''===n)throw new Ht(Gt.INVALID_ARGUMENT,'Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.');var o=this.ot.path.child(new re([n]));Ho(0==o.length%2,'Path should be a document key'),i=new De(this.firestore._databaseId,new ae(o))}else{if(!(n instanceof Ro))throw new Ht(Gt.INVALID_ARGUMENT,'Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: '+k(n)+'.');i=new De(this.firestore._databaseId,n.q)}var a=W(d,Le.fromString(e),i);return this.validateNewFilter(a),new s(this.ot.addFilter(a),this.firestore)},s.prototype.orderBy=function(t,e){f('Query.orderBy',arguments,1,2),v('Query.orderBy','string',2,e);var n;if(void 0===e||'asc'===e)n=Fe.ASCENDING;else{if('desc'!==e)throw new Ht(Gt.INVALID_ARGUMENT,'Function Query.orderBy() has unknown direction \''+e+'\', expected \'asc\' or \'desc\'.');n=Fe.DESCENDING}if(null!==this.ot.startAt)throw new Ht(Gt.INVALID_ARGUMENT,'Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().');if(null!==this.ot.endAt)throw new Ht(Gt.INVALID_ARGUMENT,'Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().');var r=At('Query.orderBy',t),o=new qe(r,n);return this.validateNewOrderBy(o),new s(this.ot.addOrderBy(o),this.firestore)},s.prototype.limit=function(t){if(m('Query.limit',arguments,1),b('Query.limit','number',1,t),0>=t)throw new Ht(Gt.INVALID_ARGUMENT,'Invalid Query. Query limit ('+t+') is invalid. Limit must be positive.');return new s(this.ot.withLimit(t),this.firestore)},s.prototype.startAt=function(t){for(var e=[],n=1;nn.length)throw new Ht(Gt.INVALID_ARGUMENT,'Too many arguments provided to '+d+'(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses');for(var r=[],o=0,i;o, or >=) must be on the same field. But you have inequality filters on \''+t+'\' and \''+o.field+'\'');var e=this.ot.getFirstOrderByField();null!==e&&this.validateOrderByAndInequalityMatch(o.field,e)}},s.prototype.validateNewOrderBy=function(n){if(null===this.ot.getFirstOrderByField()){var t=this.ot.getInequalityFilterField();null!==t&&this.validateOrderByAndInequalityMatch(t,n.field)}},s.prototype.validateOrderByAndInequalityMatch=function(n,t){if(!t.equals(n))throw new Ht(Gt.INVALID_ARGUMENT,'Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field \''+n+'\' and so you must also use \''+n+'\' as your first Query.orderBy(), but your first Query.orderBy() is on field \''+t+'\' instead.')},s}(),_o=function(){function e(o,r,e){this.Q=o,this.it=r,this.at=e,this._cachedChanges=null,this.metadata={fromCache:e.fromCache,hasPendingWrites:e.hasPendingWrites}}return Object.defineProperty(e.prototype,'docs',{get:function(){var n=[];return this.forEach(function(t){return n.push(t)}),n},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'empty',{get:function(){return this.at.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'size',{get:function(){return this.at.docs.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(o,t){var e=this;f('QuerySnapshot.forEach',arguments,1,2),b('QuerySnapshot.forEach','function',1,o),this.at.docs.forEach(function(n){o.call(t,e.convertToDocumentImpl(n))})},Object.defineProperty(e.prototype,'query',{get:function(){return new Mo(this.it,this.Q)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,'docChanges',{get:function(){return this._cachedChanges||(this._cachedChanges=xt(this.Q,this.at)),this._cachedChanges},enumerable:!0,configurable:!0}),e.prototype.convertToDocumentImpl=function(e){return new Oo(this.Q,e.key,e,this.metadata.fromCache)},e}(),Po=function(o){function t(t,a){var n=o.call(this,Pe.atPath(t),a)||this;if(1!=t.length%2)throw new Ht(Gt.INVALID_ARGUMENT,'Invalid collection reference. Collection references must have an odd number of segments, but '+t.canonicalString()+' has '+t.length);return n}return To(t,o),Object.defineProperty(t.prototype,'id',{get:function(){return this.ot.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,'parent',{get:function(){var e=this.ot.path.popLast();return e.isEmpty()?null:new Ro(new ae(e),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,'path',{get:function(){return this.ot.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.doc=function(n){if(f('CollectionReference.doc',arguments,0,1),0===arguments.length&&(n=zt.newId()),b('CollectionReference.doc','string',1,n),''===n)throw new Ht(Gt.INVALID_ARGUMENT,'Document path must be a non-empty string');var t=re.fromString(n);return Ro.forPath(this.ot.path.child(t),this.firestore)},t.prototype.add=function(n){m('CollectionReference.add',arguments,1),b('CollectionReference.add','object',1,n);var t=this.doc();return t.set(n).then(function(){return t})},t}(Mo),Lo=s(ko,'Use firebase.firestore() instead.'),Qr=s(No,'Use firebase.firestore().runTransaction() instead.'),Yr=s(Ao,'Use firebase.firestore().batch() instead.'),Jr=s(Ro,'Use firebase.firestore().doc() instead.'),$r=s(Oo),Zr=s(Mo),ea=s(_o),ta=s(Po,'Use firebase.firestore().collection() instead.'),na={Firestore:Lo,GeoPoint:Go,Blob:Yt,Transaction:Qr,WriteBatch:Yr,DocumentReference:Jr,DocumentSnapshot:$r,Query:Zr,QuerySnapshot:ea,CollectionReference:ta,FieldPath:Pn,FieldValue:yo,setLogLevel:ko.setLogLevel};t.registerFirestore=Mt,Mt(zo.default)},115:function(e,t,n){var d=Math.max,a=Math.floor;(function(t){(function(){function s(e){return'string'==typeof e}function o(){}function i(o){var r=typeof o;if('object'==r){if(!o)return'null';if(o instanceof Array)return'array';if(o instanceof Object)return r;var e=Object.prototype.toString.call(o);if('[object Window]'==e)return'object';if('[object Array]'==e||'number'==typeof o.length&&void 0!==o.splice&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable('splice'))return'array';if('[object Function]'==e||void 0!==o.call&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable('call'))return'function'}else if('function'==r&&void 0===o.call)return'object';return r}function l(e){return'array'==i(e)}function c(n){var t=i(n);return'array'==t||'object'==t&&'number'==typeof n.length}function h(e){return'function'==i(e)}function m(n){var o=typeof n;return'object'==o&&null!=n||'function'==o}function n(e){return e.call.apply(e.bind,arguments)}function p(o,a){if(!o)throw Error();if(2t?1:0}function j(n,t){t.unshift(n),u.call(this,v.apply(null,t)),t.shift()}function G(e){throw new j('Failure'+(e?': '+e:''),Array.prototype.slice.call(arguments,1))}function $(){0!=Ao&&(Lo[this[k]||(this[k]=++q)]=this),this.i=this.i,this.w=this.w}function w(a){t:{for(var t=qe,e=a.length,n=s(a)?a.split(''):a,r=0;rt?null:s(a)?a.charAt(t):a[t]}function Z(n){if(!l(n))for(var t=n.length-1;0<=t;t--)delete n[t];n.length=0}function _e(){return Array.prototype.concat.apply([],arguments)}function et(o){var t=o.length;if(0n.keyCode||void 0!=n.returnValue)){t:{var r=!1;if(0==n.keyCode)try{n.keyCode=-1;break t}catch(e){r=!0}(r||void 0==n.returnValue)&&(n.returnValue=!0)}for(n=[],r=t.a;r;r=r.parentNode)n.push(r);for(a=a.type,r=n.length-1;0<=r;r--){t.a=n[r];var o=Tt(n[r],a,!0,t);s=s&&o}for(r=0;rt.b&&(t.b++,n.next=t.a,t.a=n)}dr=!1}function zt(t,e){Lt.call(this),this.b=t||1,this.a=e||Io,this.f=f(this.ib,this),this.g=No()}function Kt(e){e.$=!1,e.K&&(e.a.clearTimeout(e.K),e.K=null)}function Gt(o,r,a){if(h(o))a&&(o=f(o,a));else{if(!o||'function'!=typeof o.handleEvent)throw Error('Invalid listener argument');o=f(o.handleEvent,o)}return 2147483647<+r?-1:Io.setTimeout(o,r||0)}function Xt(o,t,e){$.call(this),this.f=null==e?o:f(o,e),this.c=t,this.b=f(this.bb,this),this.a=[]}function Qt(e){e.X=Gt(e.b,e.c),e.f.apply(null,e.a)}function Yt(e){$.call(this),this.b=e,this.a={}}function C(e){y(e.a,function(n,t){this.a.hasOwnProperty(t)&&Et(n)},e),e.a={}}function Jt(o,t,e){this.reset(o,t,e,void 0,void 0)}function $t(e){this.f=e,this.b=this.c=this.a=null}function Zt(n,t){this.name=n,this.value=t}function D(e){return e.c?e.c:e.a?D(e.a):(G('Root logger has no level set.'),null)}function en(o){xr||(xr=new $t(''),vr['']=xr,xr.c=yr);var t;if(!(t=vr[o])){t=new $t(o);var e=o.lastIndexOf('.'),n=o.substr(e+1);e=en(o.substr(0,e)),e.b||(e.b={}),e.b[n]=t,t.a=e,vr[o]=t}return t}function tn(n,t){n&&n.log(gr,t,void 0)}function E(n,t){n&&n.log(fr,t,void 0)}function nn(n,t){n&&n.log(br,t,void 0)}function F(){this.a=en('goog.labs.net.webChannel.WebChannelDebug'),this.b=!0}function on(d,t,e,n,r,o){ln(d,function(){if(!d.b)i=o;else if(o){for(var i='',a=o.split('&'),s=0,p;so.length)){var i=o[1];if(l(i)&&!(1>i.length)){var a=i[0];if('noop'!=a&&'stop'!=a&&'close'!=a)for(var s=1;se;e++){n=t[e];try{return new ActiveXObject(n),o.b=n}catch(e){}}throw Error('Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed')}return o.b}function Sn(o,t,e,n){this.i=o,this.b=t,this.f=e,this.T=n||1,this.N=new Yt(this),this.S=Tr,o=this.H=new zt,o.b=wr,o.K&&o.$?(Kt(o),o.start()):o.K&&Kt(o),this.j=null,this.c=!1,this.m=this.g=this.h=this.J=this.D=this.U=this.w=null,this.s=[],this.a=null,this.F=0,this.l=this.o=null,this.C=-1,this.B=!1,this.P=0,this.I=null,this.M=!1}function K(n,t){return 0===n?'Non-200 return code ('+t+')':1===n?'XMLHTTP failure (no data)':2===n?'HttpConnection timeout':'Unknown error'}function En(o,t,e){o.J=1,o.h=Gn(P(t)),o.m=e,o.M=!0,Tn(o,null)}function kn(o,t,e,n){o.J=1,o.h=Gn(P(t)),o.m=null,o.M=e,Tn(o,n)}function Tn(t,e){t.D=No(),Ln(t),t.g=P(t.h),Q(t.g,'t',t.T),t.F=0,t.a=t.i.da(t.i.ia()?e:null),0t)&&(3!=t||Mo||a.a.V())){a.B||4!=t||7==e||un(8==e||0>=n?3:2),On(a);var r=a.a.W();a.C=r,(e=a.a.V())||dn(a.b,function(){return'No response text for uri '+a.g+' status '+r}),a.c=200==r,rn(a.b,a.o,a.g,a.f,a.T,t,r),a.c?(a.M?(In(a,t,e),Mo&&a.c&&3==t&&Nn(a)):(an(a.b,a.f,e,null),_n(a,e)),4==t&&Dn(a),a.c&&!a.B&&(4==t?a.i.ua(a):(a.c=!1,Ln(a)))):(400==r&&0t.length?Nr:(t=t.substr(n,e),o.F=n+e,t))}function Ln(t){t.U=No()+t.S,Rn(t,t.S)}function Rn(n,t){if(null!=n.w)throw Error('WatchDog timer not null');n.w=fn(f(n.cb,n),t)}function On(e){e.w&&(Io.clearTimeout(e.w),e.w=null)}function Pn(e){e.i.Ja()||e.B||e.i.ua(e)}function Dn(n){On(n);var t=n.I;t&&'function'==typeof t.Z&&t.Z(),n.I=null,Kt(n.H),C(n.N),n.a&&(t=n.a,n.a=null,t.abort(),t.Z())}function _n(n,t){try{n.i.Ma(n,t),un(4)}catch(t){I(n.b,t,'Error in httprequest callback')}}function Mn(o){if(o.v&&'function'==typeof o.v)return o.v();if(s(o))return o.split('');if(c(o)){for(var t=[],e=o.length,n=0;n2*n.c&&Vn(n),!0)}function Vn(a){if(a.c!=a.a.length){for(var t=0,e=0,n;tt)throw Error('Bad port number '+t);n.i=t}else n.i=null}function zn(o,t,e){t instanceof Zn?(o.c=t,ao(o.c,o.h)):(e||(t=Jn(t,Pr)),o.c=new Zn(t,o.h))}function Kn(o,t,e){o.c.set(t,e)}function Q(n,t,e){l(e)||(e=[e+'']),no(n.c,t,e)}function Gn(t){return Kn(t,'zx',a(2147483648*Math.random()).toString(36)+Math.abs(a(2147483648*Math.random())^No()).toString(36)),t}function Xn(e){return e instanceof Hn?P(e):new Hn(e,void 0)}function Qn(a,t,e,n){var r=new Hn(null,void 0);return a&&L(r,a),t&&qn(r,t),e&&jn(r,e),n&&(r.a=n),r}function Yn(n,t){return n?t?decodeURI(n.replace(/%25/g,'%2525')):decodeURIComponent(n):''}function Jn(o,t,e){return s(o)?(o=encodeURI(o).replace(t,$n),e&&(o=o.replace(/%25([0-9a-fA-F]{2})/g,'%$1')),o):null}function $n(e){return e=e.charCodeAt(0),'%'+(15&e>>4).toString(16)+(15&e).toString(16)}function Zn(n,t){this.b=this.a=null,this.c=n||null,this.f=!!t}function eo(o){o.a||(o.a=new Bn,o.b=0,o.c&&O(o.c,function(t,e){o.add(decodeURIComponent(t.replace(/\+/g,' ')),e)}))}function R(n,t){eo(n),t=ro(n,t),Wn(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,Un(n.a,t))}function to(n,t){return eo(n),t=ro(n,t),Wn(n.a.b,t)}function no(o,t,e){R(o,t),0=e.f}function be(n,t){return n.b?n.b==t:!!n.a&&n.a.contains(t)}function ce(n,t){n.a?n.a.add(t):n.b=t}function ae(n,t){n.b&&n.b==t?n.b=null:n.a&&n.a.contains(t)&&Un(n.a.a,S(t))}function de(n){if(null!=n.b)return n.c.concat(n.b.s);if(null!=n.a&&0!=n.a.a.c){var o=n.c;return Oo(n.a.v(),function(e){o=o.concat(e.s)}),o}return et(n.c)}function ee(n,t){n.c=n.c.concat(t)}function fe(){}function ge(){this.a=new fe}function he(o,a,e){var i=e||'';try{Fn(o,function(e,t){var n=e;m(e)&&(n=Pt(e)),a.push(i+t+'='+encodeURIComponent(n))})}catch(e){throw a.push(i+'type='+encodeURIComponent('_badmap')),e}}function ie(o,t){var e=new F;dn(e,'TestLoadImage: loading '+o);var n=new Image;n.onload=b(je,e,n,'TestLoadImage: loaded',!0,t),n.onerror=b(je,e,n,'TestLoadImage: error',!1,t),n.onabort=b(je,e,n,'TestLoadImage: abort',!1,t),n.ontimeout=b(je,e,n,'TestLoadImage: timeout',!1,t),Io.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=o}function je(a,t,e,n,r){try{dn(a,e),t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,r(n)}catch(t){I(a,t)}}function ke(e){Lt.call(this),this.headers=new Bn,this.F=e||null,this.f=!1,this.D=this.a=null,this.M=this.s='',this.j=0,this.g='',this.h=this.I=this.o=this.H=!1,this.l=0,this.B=null,this.N=Br,this.C=this.m=!1}function T(e){return Fo&<(9)&&'number'==typeof e.timeout&&void 0!==e.ontimeout}function qe(e){return'content-type'==e.toLowerCase()}function Co(n,t){n.f=!1,n.a&&(n.h=!0,n.a.abort(),n.h=!1),n.g=t,n.j=5,oe(n),te(n)}function oe(e){e.H||(e.H=!0,e.dispatchEvent('complete'),e.dispatchEvent('error'))}function re(s){if(s.f&&void 0!==wo)if(s.D[1]&&4==pe(s)&&2==s.W())nn(s.b,M(s,'Local request error detected and ignored'));else if(s.o&&4==pe(s))Gt(s.La,0,s);else if(s.dispatchEvent('readystatechange'),4==pe(s)){nn(s.b,M(s,'Request complete')),s.f=!1;try{var t=s.W();t:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1;}var n;if(!(n=e)){var r;if(r=0===t){var o=(s.s+'').match(Ar)[1]||null;if(!o&&Io.self&&Io.self.location){var d=Io.self.location.protocol;o=d.substr(0,d.length-1)}r=!le.test(o?o.toLowerCase():'')}n=r}n?(s.dispatchEvent('complete'),s.dispatchEvent('success')):(s.j=6,s.g=s.Ga()+' ['+s.W()+']',oe(s))}finally{te(s)}}}function te(a,t){if(a.a){se(a);var e=a.a,n=a.D[0]?o:null;a.a=null,a.D=null,t||a.dispatchEvent('ready');try{e.onreadystatechange=n}catch(t){(a=a.b)&&a.log(mr,'Problem encountered resetting onreadystatechange: '+t.message,void 0)}}}function se(e){e.a&&e.C&&(e.a.ontimeout=null),e.B&&(Io.clearTimeout(e.B),e.B=null)}function pe(e){return e.a?e.a.readyState:0}function M(n,t){return t+' ['+n.M+' '+n.s+' '+n.W()+']'}function U(n){var o='';return y(n,function(e,t){o+=t,o+=':',o+=e,o+='\r\n'}),o}function ue(a,t,e){t:{for(n in e){var n=!1;break t}n=!0}if(n)return a;if(e=U(e),s(a)){if(t=encodeURIComponent(t+''),e=null==e?'':'='+encodeURIComponent(e+''),t+=e){if(e=a.indexOf('#'),0>e&&(e=a.length),0>(n=a.indexOf('?'))||n>e){n=e;var r=''}else r=a.substring(n+1,e);a=[a.substr(0,n),r,a.substr(e)],e=a[1],a[1]=t?e?e+'&'+t:t:e,a=a[0]+(a[1]?'?'+a[1]:'')+a[2]}return a}return Kn(a,t,e),a}function ve(e){this.ya=0,this.g=[],this.a=new F,this.H=new go,this.ja=this.wa=this.F=this.ka=this.b=this.J=this.j=this.U=this.h=this.M=this.i=null,this.Ua=this.P=0,this.la=this.B=this.o=this.m=this.l=this.f=null,this.s=this.xa=this.N=-1,this.T=this.w=this.C=0,this.S=e&&e.supportsCrossDomainXhr||!1,this.I='',this.c=new bo(e&&e.concurrentRequestLimit),this.ma=new ge,this.D=!e||void 0===e.backgroundChannelTest||e.backgroundChannelTest,this.Ta=e&&e.fastHandshake||!1,e&&e.Ea&&this.a.Ea()}function we(t){if(dn(t.a,'disconnect()'),xe(t),3==t.G){var e=t.P++,n=P(t.F);Kn(n,'SID',t.I),Kn(n,'RID',e),Kn(n,'TYPE','terminate'),He(t,n),e=new Sn(t,t.a,e,void 0),e.J=2,e.h=Gn(P(n)),n=!1,Io.navigator&&Io.navigator.sendBeacon&&(n=Io.navigator.sendBeacon(''+e.h,'')),!n&&Io.Image&&(new Image().src=e.h,n=!0),n||(e.a=e.i.da(null),e.a.fa(e.h)),e.D=No(),Ln(e)}V(t)}function xe(e){e.B&&(e.B.abort(),e.B=null),e.b&&(e.b.cancel(),e.b=null),e.m&&(Io.clearTimeout(e.m),e.m=null),Eo(e),e.c.cancel(),e.l&&(Io.clearTimeout(e.l),e.l=null)}function ye(n,t){1e3==n.g.length&&H(n.a,function(){return'Already have 1000 queued maps upon queueing '+Pt(t)}),n.g.push(new yo(n.Ua++,t)),3==n.G&&Ce(n)}function Ce(e){xo(e.c)||e.l||(e.l=fn(f(e.Oa,e),0),e.C=0)}function De(o,t){var e=o.c;return(e.b?1:e.a?e.a.u():0)>=o.c.f-(o.l?1:0)?(H(o.a,'Unexpected retry request is scheduled.'),!1):o.l?(dn(o.a,'Use the retry request that is already scheduled.'),o.g=t.s.concat(o.g),!0):!(1==o.G||2==o.G||2<=o.C||(dn(o.a,'Going to retry POST'),o.l=fn(f(o.Oa,o,t),Be(o,o.C)),o.C++,0))}function Ee(o,t){var e=t?t.f:o.P++;var n=P(o.F);Kn(n,'SID',o.I),Kn(n,'RID',e),Kn(n,'AID',o.N),He(o,n),o.h&&o.i&&ue(n,o.h,o.i),e=new Sn(o,o.a,e,o.C+1),null===o.h&&(e.j=o.i),t&&(o.g=t.s.concat(o.g)),t=ze(o,e),e.setTimeout(10000+Math.round(1e4*Math.random())),ce(o.c,e),En(e,n,t)}function He(n,o){n.f&&Fn({},function(e,t){Kn(o,t,e)})}function ze(r,t){var e=Math.min(r.g.length,1e3),n=r.f?f(r.f.Va,r.f,r):null;t:for(var o=r.g,i=-1,a;;){a=['count='+e],-1==i?0(c-=i))i=d(0,o[p].a-100),s=!1;else try{he(u,a,'req'+c+'_')}catch(e){n&&n(u)}}if(s){n=a.join('&');break t}}return r=r.g.splice(0,e),t.s=r,n}function Ge(n){if(!n.b&&!n.m){n.T=1;var t=n.Na;cr||qt(),dr||(cr(),dr=!0),lr.add(t,n),n.w=0}}function Ie(e){return e.b||e.m?(H(e.a,'Request already in progress'),!1):!(3<=e.w||(dn(e.a,'Going to retry GET'),e.T++,e.m=fn(f(e.Na,e),Be(e,e.w)),e.w++,0))}function Je(o,t,e){dn(o.a,'Test Connection Finished');var n=t.m;n&&vo(o.c,n),o.la=e,o.s=t.f,dn(o.a,'connectChannel_()'),o.F=Ae(o,o.ka),Ce(o)}function So(n,t){dn(n.a,'Test Connection Failed'),n.s=t.f,Fe(n,2)}function Eo(e){null!=e.o&&(Io.clearTimeout(e.o),e.o=null)}function Be(o,t){var e=5e3+a(1e4*Math.random());return o.ra()||(dn(o.a,'Inactive channel'),e*=2),e*t}function Fe(r,t){if(ln(r.a,'Error code '+t),2==t){var e=null;r.f&&(e=null);var n=f(r.hb,r);e||(e=new Hn('//www.google.com/images/cleardot.gif'),Io.location&&'http'==Io.location.protocol||L(e,'https'),Gn(e)),ie(''+e,n)}else mn(2);dn(r.a,'HttpChannel: error - '+t),r.G=0,r.f&&r.f.Ba(t),V(r),xe(r)}function V(n){if(n.G=0,n.s=-1,n.f){var t=de(n.c);0==t.length&&0==n.g.length||(dn(n.a,function(){return'Number of undelivered maps, pending: '+t.length+', outgoing: '+n.g.length}),n.c.c.length=0,et(n.g),n.g.length=0),n.f.Aa()}}function Ae(n,t){return t=ko(n,null,t),dn(n.a,'GetForwardChannelUri: '+t),t}function Ke(o,t,e){return t=ko(o,o.ia()?t:null,e),dn(o.a,'GetBackChannelUri: '+t),t}function ko(a,t,e){var n=Xn(e);if(''!=n.b)t&&qn(n,t+'.'+n.b),jn(n,n.i);else{var r=Io.location,i;i=t?t+'.'+r.hostname:r.hostname,n=Qn(r.protocol,i,r.port,e)}return a.U&&y(a.U,function(o,t){Kn(n,t,o)}),t=a.j,e=a.J,t&&e&&Kn(n,t,e),Kn(n,'VER',a.oa),He(a,n),n}function Le(){}function Me(){for(var t=arguments[0],e=1,n;ethis.c)throw Error(Ur);this.a=new Pe,this.b=new fo,this.g=null,this.ba()}function Ve(n){if('function'==typeof n.Z)n.Z();else for(var t in n)n[t]=null}function Xe(n,t){this.a=n,this.b=t}function Ye(o){if(this.a=[],o)t:{if(o instanceof Ye){var t=o.O();if(o=o.v(),0>=this.u()){for(var e=this.a,n=0;n>1,o[n].a>e.a);)o[t]=o[n],t=n;o[t]=e}function $e(){Ye.call(this)}function To(n,t){this.f=new $e,Ue.call(this,n,t)}function X(o,t,e,n){this.l=o,this.j=!!n,To.call(this,t,e)}var wo=wo||{},Io=this,k='closure_uid_'+(1e9*Math.random()>>>0),q=0,No=Date.now||function(){return+new Date},t;r(u,Error),u.prototype.name='CustomError';var g=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,'')};r(j,u),j.prototype.name='AssertionError';var Ao=0,Lo={};$.prototype.i=!1,$.prototype.Z=function(){},$.prototype.A=function(){if(this.w)for(;this.w.length;)this.w.shift()()};var Ro=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(o,t){if(s(o))return s(t)&&1==t.length?o.indexOf(t,0):-1;for(var e=0;eparseFloat(Ho)){Wo=jo+'';break t}}Wo=Ho}var zo={},Ko=Io.document,Go;Go=Ko&&Fo?dt()||('CSS1Compat'==Ko.compatMode?parseInt(Wo,10):5):void 0;var Xo=Object.freeze||function(e){return e},Qo=!Fo||9<=+Go,Yo=Fo&&!lt('9'),Jo=function(){if(!Io.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},'passive',{get:function(){n=!0}});return Io.addEventListener('test',o,t),Io.removeEventListener('test',o,t),n}();pt.prototype.b=function(){this.Pa=!1},r(A,pt);var $o=Xo({2:'touch',3:'pen',4:'mouse'});A.prototype.b=function(){A.L.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Yo)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var Zo='closure_listenable_'+(0|1e6*Math.random()),er=0;mt.prototype.add=function(s,t,e,n,d){var o=''+s;(s=this.a[o])||(s=this.a[o]=[],this.b++);var i=yt(s,t,n,d);return-1>>0);r(Lt,$),Lt.prototype[Zo]=!0,t=Lt.prototype,t.addEventListener=function(o,t,e,n){bt(this,o,t,e,n)},t.removeEventListener=function(o,t,e,n){St(this,o,t,e,n)},t.dispatchEvent=function(d){var t=this.J,n;if(t)for(n=[];t;t=t.J)n.push(t);t=this.P;var e=d.type||d;if(s(d))d=new pt(d,t);else if(d instanceof pt)d.target=d.target||t;else{var r=d;d=new pt(e,t),at(d,r)}if(r=!0,n)for(var o=n.length-1,i;0<=o;o--)i=d.a=n[o],r=B(i,e,!0,d)&&r;if(i=d.a=t,r=B(i,e,!0,d)&&r,r=B(i,e,!1,d)&&r,n)for(o=0;o=D(this).value)for(h(t)&&(t=t()),o=new Jt(o,t+'',this.f),e&&(o.a=e),e=this;e;)e=e.a};var vr={},xr=null;F.prototype.Ea=function(){this.b=!1};var Cr=new Lt;r(cn,pt),r(hn,pt),r(J,pt);var Sr={NO_ERROR:0,jb:1,qb:2,pb:3,mb:4,ob:5,rb:6,Ra:7,TIMEOUT:8,ub:9},Er={lb:'complete',yb:'success',Sa:'error',Ra:'abort',wb:'ready',xb:'readystatechange',TIMEOUT:'timeout',sb:'incrementaldata',vb:'progress',nb:'downloadprogress',zb:'uploadprogress'};yn.prototype.a=null;var kr;r(vn,yn),kr=new vn;var Tr=45e3,wr=250,Ir={},Nr={};t=Sn.prototype,t.setTimeout=function(e){this.S=e},t.fb=function(n){n=n.target;var t=this.I;t&&3==pe(n)?(dn(this.b,'Throttling readystatechange.'),t.Xa()):this.Qa(n)},t.Qa=function(n){try{n==this.a?wn(this):tn(this.b.a,'Called back with an unexpected xmlhttp')}catch(e){if(dn(this.b,'Failed call to OnXmlHttpReadyStateChanged_'),this.a&&this.a.V()){var t=this;I(this.b,e,function(){return'ResponseText: '+t.a.V()})}else I(this.b,e,'No response text')}},t.eb=function(){var n=pe(this.a),t=this.a.V();this.Ft&&this.la&&0==this.w&&!this.o&&(this.o=fn(f(this.$a,this),6e3)))}else if(this.b==n&&Eo(this),!/^[\s\xa0]*$/.test(t))for(t=e=this.ma.a.parse(t),e=0;et-this.g)){for(var e;0this.c&&0=r)o=void 0;else{if(1==r)Z(n);else{n[0]=n.pop(),n=0,l=l.a,r=l.length;for(var i=l[n];n>1;){var a=2*n+1,s=2*n+2;if(a=si.a)break;l[n]=l[a],n=a}l[n]=i}o=o.b}o.apply(this,[t])}},t.na=function(e){To.L.na.call(this,e),this.sa()},t.ba=function(){To.L.ba.call(this),this.sa()},t.A=function(){To.L.A.call(this),Io.clearTimeout(void 0),Z(this.f.a),this.f=null},r(X,To),X.prototype.qa=function(){var o=new ke,t=this.l;return t&&t.forEach(function(t,e){o.headers.set(e,t)}),this.j&&(o.m=!0),o},X.prototype.ta=function(e){return!e.i&&!e.a},Ne.prototype.createWebChannel=Ne.prototype.a,Oe.prototype.send=Oe.prototype.l,Oe.prototype.open=Oe.prototype.j,Oe.prototype.close=Oe.prototype.close,Sr.NO_ERROR=0,Sr.TIMEOUT=8,Sr.HTTP_ERROR=6,Er.COMPLETE='complete',po.EventType=Mr,Mr.OPEN='a',Mr.CLOSE='b',Mr.ERROR='c',Mr.MESSAGE='d',Lt.prototype.listen=Lt.prototype.aa,X.prototype.getObject=X.prototype.ea,X.prototype.releaseObject=X.prototype.gb,ke.prototype.listenOnce=ke.prototype.Ha,ke.prototype.getLastError=ke.prototype.Za,ke.prototype.getLastErrorCode=ke.prototype.Fa,ke.prototype.getStatus=ke.prototype.W,ke.prototype.getStatusText=ke.prototype.Ga,ke.prototype.getResponseJson=ke.prototype.Ya,ke.prototype.getResponseText=ke.prototype.V,ke.prototype.getResponseText=ke.prototype.V,ke.prototype.send=ke.prototype.fa,e.exports={createWebChannelTransport:ne,ErrorCode:Sr,EventType:Er,WebChannel:po,XhrIoPool:X}}).call(void 0===t?'undefined'==typeof self?'undefined'==typeof window?{}:window:self:t)}).call(t,n(12))}},[113])}catch(e){throw Error('Cannot instantiate firebase-firestore.js - be sure to load firebase-app.js first.')}