silverstripe-webpack/app/client/dist/js/app.js

2 lines
288 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="app/client/dist/",e(e.s=6)}([function(t,e){t.exports=jQuery},function(t,e,n){(function(e){var n=function(t){function e(t){return{}.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase()}function n(){return{bindType:i,delegateType:i,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}}function r(e){var n=this,r=!1;return t(this).one(o.TRANSITION_END,function(){r=!0}),setTimeout(function(){r||o.triggerTransitionEnd(n)},e),this}var i="transitionend",o={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(e){var n=e.getAttribute("data-target");n&&"#"!==n||(n=e.getAttribute("href")||"");try{return t(document).find(n).length>0?n:null}catch(t){return null}},getTransitionDurationFromElement:function(e){if(!e)return 0;var n=t(e).css("transition-duration");return parseFloat(n)?(n=n.split(",")[0],1e3*parseFloat(n)):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(i)},supportsTransitionEnd:function(){return Boolean(i)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,n,r){for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i],a=n[i],c=a&&o.isElement(a)?"element":e(a);if(!new RegExp(s).test(c))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+c+'" but expected type "'+s+'".')}}};return function(){t.fn.emulateTransitionEnd=r,t.event.special[o.TRANSITION_END]=n()}(),o}(e);t.exports=n}).call(e,n(0))},function(t,e){t.exports={AJAX:"ajax-load",LOADED:"load"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){function n(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function r(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},ft))}}function i(t){var e={};return t&&"[object Function]"===e.toString.call(t)}function o(t,e){if(1!==t.nodeType)return[];var n=getComputedStyle(t,null);return e?n[e]:n}function s(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function a(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=o(t),n=e.overflow,r=e.overflowX;return/(auto|scroll|overlay)/.test(n+e.overflowY+r)?t:a(s(t))}function c(t){return 11===t?vt:10===t?gt:vt||gt}function u(t){if(!t)return document.documentElement;for(var e=c(10)?document.body:null,n=t.offsetParent;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TD","TABLE"].indexOf(n.nodeName)&&"static"===o(n,"position")?u(n):n:t?t.ownerDocument.documentElement:document.documentElement}function l(t){var e=t.nodeName;return"BODY"!==e&&("HTML"===e||u(t.firstElementChild)===t)}function f(t){return null!==t.parentNode?f(t.parentNode):t}function h(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,i=n?e:t,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var s=o.commonAncestorContainer;if(t!==s&&e!==s||r.contains(i))return l(s)?s:u(s);var a=f(t);return a.host?h(a.host,e):h(t,f(e).host)}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",r=t.nodeName;if("BODY"===r||"HTML"===r){var i=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||i)[n]}return t[n]}function p(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=d(e,"top"),i=d(e,"left"),o=n?-1:1;return t.top+=r*o,t.bottom+=r*o,t.left+=i*o,t.right+=i*o,t}function v(t,e){var n="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+r+"Width"],10)}function g(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],c(10)?n["offset"+t]+r["margin"+("Height"===t?"Top":"Left")]+r["margin"+("Height"===t?"Bottom":"Right")]:0)}function m(){var t=document.body,e=document.documentElement,n=c(10)&&getComputedStyle(e);return{height:g("Height",t,e,n),width:g("Width",t,e,n)}}function _(t){return bt({},t,{right:t.left+t.width,bottom:t.top+t.height})}function y(t){var e={};try{if(c(10)){e=t.getBoundingClientRect();var n=d(t,"top"),r=d(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}else e=t.getBoundingClientRect()}catch(t){}var i={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},s="HTML"===t.nodeName?m():{},a=s.width||t.clientWidth||i.right-i.left,u=s.height||t.clientHeight||i.bottom-i.top,l=t.offsetWidth-a,f=t.offsetHeight-u;if(l||f){var h=o(t);l-=v(h,"x"),f-=v(h,"y"),i.width-=l,i.height-=f}return _(i)}function b(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=c(10),i="HTML"===e.nodeName,s=y(t),u=y(e),l=a(t),f=o(e),h=parseFloat(f.borderTopWidth,10),d=parseFloat(f.borderLeftWidth,10);n&&"HTML"===e.nodeName&&(u.top=Math.max(u.top,0),u.left=Math.max(u.left,0));var v=_({top:s.top-u.top-h,left:s.left-u.left-d,width:s.width,height:s.height});if(v.marginTop=0,v.marginLeft=0,!r&&i){var g=parseFloat(f.marginTop,10),m=parseFloat(f.marginLeft,10);v.top-=h-g,v.bottom-=h-g,v.left-=d-m,v.right-=d-m,v.marginTop=g,v.marginLeft=m}return(r&&!n?e.contains(l):e===l&&"BODY"!==l.nodeName)&&(v=p(v,e)),v}function E(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,r=b(t,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=e?0:d(n),a=e?0:d(n,"left");return _({top:s-r.top+r.marginTop,left:a-r.left+r.marginLeft,width:i,height:o})}function w(t){var e=t.nodeName;return"BODY"!==e&&"HTML"!==e&&("fixed"===o(t,"position")||w(s(t)))}function T(t){if(!t||!t.parentElement||c())return document.documentElement;for(var e=t.parentElement;e&&"none"===o(e,"transform");)e=e.parentElement;return e||document.documentElement}function C(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},c=i?T(t):h(t,e);if("viewport"===r)o=E(c,i);else{var u=void 0;"scrollParent"===r?(u=a(s(e)),"BODY"===u.nodeName&&(u=t.ownerDocument.documentElement)):u="window"===r?t.ownerDocument.documentElement:r;var l=b(u,c,i);if("HTML"!==u.nodeName||w(c))o=l;else{var f=m(),d=f.height,p=f.width;o.top+=l.top-l.marginTop,o.bottom=d+l.top,o.left+=l.left-l.marginLeft,o.right=p+l.left}}return o.left+=n,o.top+=n,o.right-=n,o.bottom-=n,o}function S(t){return t.width*t.height}function O(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=C(n,r,o,i),a={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},c=Object.keys(a).map(function(t){return bt({key:t},a[t],{area:S(a[t])})}).sort(function(t,e){return e.area-t.area}),u=c.filter(function(t){var e=t.width,r=t.height;return e>=n.clientWidth&&r>=n.clientHeight}),l=u.length>0?u[0].key:c[0].key,f=t.split("-")[1];return l+(f?"-"+f:"")}function A(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return b(n,r?T(e):h(e,n),r)}function I(t){var e=getComputedStyle(t),n=parseFloat(e.marginTop)+parseFloat(e.marginBottom),r=parseFloat(e.marginLeft)+parseFloat(e.marginRight);return{width:t.offsetWidth+r,height:t.offsetHeight+n}}function D(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function k(t,e,n){n=n.split("-")[0];var r=I(t),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",c=o?"height":"width",u=o?"width":"height";return i[s]=e[s]+e[c]/2-r[c]/2,i[a]=n===a?e[a]-r[u]:e[D(a)],i}function x(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function N(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var r=x(t,function(t){return t[e]===n});return t.indexOf(r)}function L(t,e,n){return(void 0===n?t:t.slice(0,N(t,"name",n))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&i(n)&&(e.offsets.popper=_(e.offsets.popper),e.offsets.reference=_(e.offsets.reference),e=n(e,t))}),e}function j(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=A(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=O(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=k(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=L(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function R(t,e){return t.some(function(t){var n=t.name;return t.enabled&&n===e})}function q(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r<e.length;r++){var i=e[r],o=i?""+i+n:t;if(void 0!==document.body.style[o])return o}return null}function P(){return this.state.isDestroyed=!0,R(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[q("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function F(t){var e=t.ownerDocument;return e?e.defaultView:window}function M(t,e,n,r){var i="BODY"===t.nodeName,o=i?t.ownerDocument.defaultView:t;o.addEventListener(e,n,{passive:!0}),i||M(a(o.parentNode),e,n,r),r.push(o)}function U(t,e,n,r){n.updateBound=r,F(t).addEventListener("resize",n.updateBound,{passive:!0});var i=a(t);return M(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function H(){this.state.eventsEnabled||(this.state=U(this.reference,this.options,this.state,this.scheduleUpdate))}function W(t,e){return F(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach(function(t){t.removeEventListener("scroll",e.updateBound)}),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e}function B(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=W(this.reference,this.state))}function V(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e){Object.keys(e).forEach(function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&V(e[n])&&(r="px"),t.style[n]=e[n]+r})}function K(t,e){Object.keys(e).forEach(function(n){!1!==e[n]?t.setAttribute(n,e[n]):t.removeAttribute(n)})}function $(t){return G(t.instance.popper,t.styles),K(t.instance.popper,t.attributes),t.arrowElement&&Object.keys(t.arrowStyles).length&&G(t.arrowElement,t.arrowStyles),t}function X(t,e,n,r,i){var o=A(i,e,t,n.positionFixed),s=O(n.placement,o,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",s),G(e,{position:n.positionFixed?"fixed":"absolute"}),n}function z(t,e){var n=e.x,r=e.y,i=t.offsets.popper,o=x(t.instance.modifiers,function(t){return"applyStyle"===t.name}).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var s=void 0!==o?o:e.gpuAcceleration,a=u(t.instance.popper),c=y(a),l={position:i.position},f={left:Math.floor(i.left),top:Math.round(i.top),bottom:Math.round(i.bottom),right:Math.floor(i.right)},h="bottom"===n?"top":"bottom",d="right"===r?"left":"right",p=q("transform"),v=void 0,g=void 0;if(g="bottom"===h?-c.height+f.bottom:f.top,v="right"===d?-c.width+f.right:f.left,s&&p)l[p]="translate3d("+v+"px, "+g+"px, 0)",l[h]=0,l[d]=0,l.willChange="transform";else{var m="bottom"===h?-1:1,_="right"===d?-1:1;l[h]=g*m,l[d]=v*_,l.willChange=h+", "+d}var b={"x-placement":t.placement};return t.attributes=bt({},b,t.attributes),t.styles=bt({},l,t.styles),t.arrowStyles=bt({},t.offsets.arrow,t.arrowStyles),t}function Y(t,e,n){var r=x(t,function(t){return t.name===e}),i=!!r&&t.some(function(t){return t.name===n&&t.enabled&&t.order<r.order});if(!i){var o="`"+e+"`",s="`"+n+"`";console.warn(s+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}function Q(t,e){var n;if(!Y(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if("string"==typeof r){if(!(r=t.instance.popper.querySelector(r)))return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],s=t.offsets,a=s.popper,c=s.reference,u=-1!==["left","right"].indexOf(i),l=u?"height":"width",f=u?"Top":"Left",h=f.toLowerCase(),d=u?"left":"top",p=u?"bottom":"right",v=I(r)[l];c[p]-v<a[h]&&(t.offsets.popper[h]-=a[h]-(c[p]-v)),c[h]+v>a[p]&&(t.offsets.popper[h]+=c[h]+v-a[p]),t.offsets.popper=_(t.offsets.popper);var g=c[h]+c[l]/2-v/2,m=o(t.instance.popper),y=parseFloat(m["margin"+f],10),b=parseFloat(m["border"+f+"Width"],10),E=g-t.offsets.popper[h]-y-b;return E=Math.max(Math.min(a[l]-v,E),0),t.arrowElement=r,t.offsets.arrow=(n={},yt(n,h,Math.round(E)),yt(n,d,""),n),t}function J(t){return"end"===t?"start":"start"===t?"end":t}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=wt.indexOf(t),r=wt.slice(n+1).concat(wt.slice(0,n));return e?r.reverse():r}function tt(t,e){if(R(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=C(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],i=D(r),o=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case Tt.FLIP:s=[r,i];break;case Tt.CLOCKWISE:s=Z(r);break;case Tt.COUNTERCLOCKWISE:s=Z(r,!0);break;default:s=e.behavior}return s.forEach(function(a,c){if(r!==a||s.length===c+1)return t;r=t.placement.split("-")[0],i=D(r);var u=t.offsets.popper,l=t.offsets.reference,f=Math.floor,h="left"===r&&f(u.right)>f(l.left)||"right"===r&&f(u.left)<f(l.right)||"top"===r&&f(u.bottom)>f(l.top)||"bottom"===r&&f(u.top)<f(l.bottom),d=f(u.left)<f(n.left),p=f(u.right)>f(n.right),v=f(u.top)<f(n.top),g=f(u.bottom)>f(n.bottom),m="left"===r&&d||"right"===r&&p||"top"===r&&v||"bottom"===r&&g,_=-1!==["top","bottom"].indexOf(r),y=!!e.flipVariations&&(_&&"start"===o&&d||_&&"end"===o&&p||!_&&"start"===o&&v||!_&&"end"===o&&g);(h||m||y)&&(t.flipped=!0,(h||m)&&(r=s[c+1]),y&&(o=J(o)),t.placement=r+(o?"-"+o:""),t.offsets.popper=bt({},t.offsets.popper,k(t.instance.popper,t.offsets.reference,t.placement)),t=L(t.instance.modifiers,t,"flip"))}),t}function et(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(i),a=s?"right":"bottom",c=s?"left":"top",u=s?"width":"height";return n[a]<o(r[c])&&(t.offsets.popper[c]=o(r[c])-n[u]),n[c]>o(r[a])&&(t.offsets.popper[c]=o(r[a])),t}function nt(t,e,n,r){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],s=i[2];if(!o)return t;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=r}return _(a)[e]/100*o}return"vh"===s||"vw"===s?("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o:o}function rt(t,e,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),s=t.split(/(\+|\-)/).map(function(t){return t.trim()}),a=s.indexOf(x(s,function(t){return-1!==t.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,u=-1!==a?[s.slice(0,a).concat([s[a].split(c)[0]]),[s[a].split(c)[1]].concat(s.slice(a+1))]:[s];return u=u.map(function(t,r){var i=(1===r?!o:o)?"height":"width",s=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,s=!0,t):s?(t[t.length-1]+=e,s=!1,t):t.concat(e)},[]).map(function(t){return nt(t,i,e,n)})}),u.forEach(function(t,e){t.forEach(function(n,r){V(n)&&(i[e]+=n*("-"===t[r-1]?-1:1))})}),i}function it(t,e){var n=e.offset,r=t.placement,i=t.offsets,o=i.popper,s=i.reference,a=r.split("-")[0],c=void 0;return c=V(+n)?[+n,0]:rt(n,o,s,a),"left"===a?(o.top+=c[0],o.left-=c[1]):"right"===a?(o.top+=c[0],o.left+=c[1]):"top"===a?(o.left+=c[0],o.top-=c[1]):"bottom"===a&&(o.left+=c[0],o.top+=c[1]),t.popper=o,t}function ot(t,e){var n=e.boundariesElement||u(t.instance.popper);t.instance.reference===n&&(n=u(n));var r=q("transform"),i=t.instance.popper.style,o=i.top,s=i.left,a=i[r];i.top="",i.left="",i[r]="";var c=C(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);i.top=o,i.left=s,i[r]=a,e.boundaries=c;var l=e.priority,f=t.offsets.popper,h={primary:function(t){var n=f[t];return f[t]<c[t]&&!e.escapeWithReference&&(n=Math.max(f[t],c[t])),yt({},t,n)},secondary:function(t){var n="right"===t?"left":"top",r=f[n];return f[t]>c[t]&&!e.escapeWithReference&&(r=Math.min(f[n],c[t]-("right"===t?f.width:f.height))),yt({},n,r)}};return l.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";f=bt({},f,h[e](t))}),t.offsets.popper=f,t}function st(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets,o=i.reference,s=i.popper,a=-1!==["bottom","top"].indexOf(n),c=a?"left":"top",u=a?"width":"height",l={start:yt({},c,o[c]),end:yt({},c,o[c]+o[u]-s[u])};t.offsets.popper=bt({},s,l[r])}return t}function at(t){if(!Y(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=x(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}function ct(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,i=r.popper,o=r.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return i[s?"left":"top"]=o[n]-(a?i[s?"width":"height"]:0),t.placement=D(e),t.offsets.popper=_(i),t}for(var ut="undefined"!=typeof window&&"undefined"!=typeof document,lt=["Edge","Trident","Firefox"],ft=0,ht=0;ht<lt.length;ht+=1)if(ut&&navigator.userAgent.indexOf(lt[ht])>=0){ft=1;break}var dt=ut&&window.Promise,pt=dt?n:r,vt=ut&&!(!window.MSInputMethodContext||!document.documentMode),gt=ut&&/MSIE 10/.test(navigator.userAgent),mt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},_t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),yt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},bt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Et=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],wt=Et.slice(3),Tt={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},Ct={shift:{order:100,enabled:!0,fn:st},offset:{order:200,enabled:!0,fn:it,offset:0},preventOverflow:{order:300,enabled:!0,fn:ot,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:et},arrow:{order:500,enabled:!0,fn:Q,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:tt,behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:ct},hide:{order:800,enabled:!0,fn:at},computeStyle:{order:850,enabled:!0,fn:z,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:$,onLoad:X,gpuAcceleration:void 0}},St={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Ct},Ot=function(){function t(e,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};mt(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=pt(this.update.bind(this)),this.options=bt({},t.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(bt({},t.Defaults.modifiers,o.modifiers)).forEach(function(e){r.options.modifiers[e]=bt({},t.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return bt({name:t},r.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&i(t.onLoad)&&t.onLoad(r.reference,r.popper,r.options,t,r.state)}),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return _t(t,[{key:"update",value:function(){return j.call(this)}},{key:"destroy",value:function(){return P.call(this)}},{key:"enableEventListeners",value:function(){return H.call(this)}},{key:"disableEventListeners",value:function(){return B.call(this)}}]),t}();Ot.Utils=("undefined"!=typeof window?window:t).PopperUtils,Ot.placements=Et,Ot.Defaults=St,e.default=Ot}.call(e,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r;!function(i,o,s,a){"use strict";function c(t,e,n){return setTimeout(d(t,n),e)}function u(t,e,n){return!!Array.isArray(t)&&(l(t,n[e],n),!0)}function l(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function f(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}function h(t,e,n){var r,i=e.prototype;r=t.prototype=Object.create(i),r.constructor=t,r._super=i,n&&pt(r,n)}function d(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==mt?t.apply(e?e[0]||a:a,e):t}function v(t,e){return t===a?e:t}function g(t,e,n){l(b(e),function(e){t.addEventListener(e,n,!1)})}function m(t,e,n){l(b(e),function(e){t.removeEventListener(e,n,!1)})}function _(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function y(t,e){return t.indexOf(e)>-1}function b(t){return t.trim().split(/\s+/g)}function E(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function w(t){return Array.prototype.slice.call(t,0)}function T(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];E(i,s)<0&&r.push(t[o]),i[o]=s,o++}return n&&(r=e?r.sort(function(t,n){return t[e]>n[e]}):r.sort()),r}function C(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<vt.length;){if(n=vt[o],(r=n?n+i:e)in t)return r;o++}return a}function S(){return Tt++}function O(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}function A(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){p(t.options.enable,[t])&&n.handler(e)},this.init()}function I(t){return new(t.options.inputClass||(Ot?W:At?G:St?$:H))(t,D)}function D(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=e&Dt&&r-i==0,s=e&(xt|Nt)&&r-i==0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,k(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function k(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=L(e)),i>1&&!n.firstMultiple?n.firstMultiple=L(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,c=e.center=j(r);e.timeStamp=bt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=F(a,c),e.distance=P(a,c),x(n,e),e.offsetDirection=q(e.deltaX,e.deltaY);var u=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=yt(u.x)>yt(u.y)?u.x:u.y,e.scale=s?U(s.pointers,r):1,e.rotation=s?M(s.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,N(n,e);var l=t.element;_(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function x(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Dt&&o.eventType!==xt||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}function N(t,e){var n,r,i,o,s=t.lastInterval||e,c=e.timeStamp-s.timeStamp;if(e.eventType!=Nt&&(c>It||s.velocity===a)){var u=e.deltaX-s.deltaX,l=e.deltaY-s.deltaY,f=R(c,u,l);r=f.x,i=f.y,n=yt(f.x)>yt(f.y)?f.x:f.y,o=q(u,l),t.lastInterval=e}else n=s.velocity,r=s.velocityX,i=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}function L(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:_t(t.pointers[n].clientX),clientY:_t(t.pointers[n].clientY)},n++;return{timeStamp:bt(),pointers:e,center:j(e),deltaX:t.deltaX,deltaY:t.deltaY}}function j(t){var e=t.length;if(1===e)return{x:_t(t[0].clientX),y:_t(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:_t(n/e),y:_t(r/e)}}function R(t,e,n){return{x:e/t||0,y:n/t||0}}function q(t,e){return t===e?Lt:yt(t)>=yt(e)?t<0?jt:Rt:e<0?qt:Pt}function P(t,e,n){n||(n=Ht);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function F(t,e,n){n||(n=Ht);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function M(t,e){return F(e[1],e[0],Wt)+F(t[1],t[0],Wt)}function U(t,e){return P(e[0],e[1],Wt)/P(t[0],t[1],Wt)}function H(){this.evEl=Vt,this.evWin=Gt,this.pressed=!1,A.apply(this,arguments)}function W(){this.evEl=Xt,this.evWin=zt,A.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function B(){this.evTarget=Qt,this.evWin=Jt,this.started=!1,A.apply(this,arguments)}function V(t,e){var n=w(t.touches),r=w(t.changedTouches);return e&(xt|Nt)&&(n=T(n.concat(r),"identifier",!0)),[n,r]}function G(){this.evTarget=te,this.targetIds={},A.apply(this,arguments)}function K(t,e){var n=w(t.touches),r=this.targetIds;if(e&(Dt|kt)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=w(t.changedTouches),a=[],c=this.target;if(o=n.filter(function(t){return _(t.target,c)}),e===Dt)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),e&(xt|Nt)&&delete r[s[i].identifier],i++;return a.length?[T(o.concat(a),"identifier",!0),a]:void 0}function $(){A.apply(this,arguments);var t=d(this.handler,this);this.touch=new G(this.manager,t),this.mouse=new H(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function X(t,e){t&Dt?(this.primaryTouch=e.changedPointers[0].identifier,z.call(this,e)):t&(xt|Nt)&&z.call(this,e)}function z(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches,i=function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)};setTimeout(i,ee)}}function Y(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),s=Math.abs(n-i.y);if(o<=ne&&s<=ne)return!0}return!1}function Q(t,e){this.manager=t,this.set(e)}function J(t){if(y(t,ae))return ae;var e=y(t,ce),n=y(t,ue);return e&&n?ae:e||n?e?ce:ue:y(t,se)?se:oe}function Z(t){this.options=pt({},this.defaults,t||{}),this.id=S(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=fe,this.simultaneous={},this.requireFail=[]}function tt(t){return t&ge?"cancel":t&pe?"end":t&de?"move":t&he?"start":""}function et(t){return t==Pt?"down":t==qt?"up":t==jt?"left":t==Rt?"right":""}function nt(t,e){var n=e.manager;return n?n.get(t):t}function rt(){Z.apply(this,arguments)}function it(){rt.apply(this,arguments),this.pX=null,this.pY=null}function ot(){rt.apply(this,arguments)}function st(){Z.apply(this,arguments),this._timer=null,this._input=null}function at(){rt.apply(this,arguments)}function ct(){rt.apply(this,arguments)}function ut(){Z.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function lt(t,e){return e=e||{},e.recognizers=v(e.recognizers,lt.defaults.preset),new ft(t,e)}function ft(t,e){this.options=pt({},lt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=I(this),this.touchAction=new Q(this,this.options.touchAction),ht(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ht(t,e){var n=t.element;if(n.style){var r;l(t.options.cssProps,function(i,o){r=C(n.style,o),e?(t.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=t.oldCssProps[r]||""}),e||(t.oldCssProps={})}}function dt(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var pt,vt=["","webkit","Moz","MS","ms","o"],gt=o.createElement("div"),mt="function",_t=Math.round,yt=Math.abs,bt=Date.now;pt="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==a&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var Et=f(function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&t[r[i]]===a)&&(t[r[i]]=e[r[i]]),i++;return t},"extend","Use `assign`."),wt=f(function(t,e){return Et(t,e,!0)},"merge","Use `assign`."),Tt=1,Ct=/mobile|tablet|ip(ad|hone|od)|android/i,St="ontouchstart"in i,Ot=C(i,"PointerEvent")!==a,At=St&&Ct.test(navigator.userAgent),It=25,Dt=1,kt=2,xt=4,Nt=8,Lt=1,jt=2,Rt=4,qt=8,Pt=16,Ft=jt|Rt,Mt=qt|Pt,Ut=Ft|Mt,Ht=["x","y"],Wt=["clientX","clientY"];A.prototype={handler:function(){},init:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(O(this.element),this.evWin,this.domHandler)}};var Bt={mousedown:Dt,mousemove:kt,mouseup:xt},Vt="mousedown",Gt="mousemove mouseup";h(H,A,{handler:function(t){var e=Bt[t.type];e&Dt&&0===t.button&&(this.pressed=!0),e&kt&&1!==t.which&&(e=xt),this.pressed&&(e&xt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var Kt={pointerdown:Dt,pointermove:kt,pointerup:xt,pointercancel:Nt,pointerout:Nt},$t={2:"touch",3:"pen",4:"mouse",5:"kinect"},Xt="pointerdown",zt="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&(Xt="MSPointerDown",zt="MSPointerMove MSPointerUp MSPointerCancel"),h(W,A,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=Kt[r],o=$t[t.pointerType]||t.pointerType,s="touch"==o,a=E(e,t.pointerId,"pointerId");i&Dt&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):i&(xt|Nt)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))}});var Yt={touchstart:Dt,touchmove:kt,touchend:xt,touchcancel:Nt},Qt="touchstart",Jt="touchstart touchmove touchend touchcancel";h(B,A,{handler:function(t){var e=Yt[t.type];if(e===Dt&&(this.started=!0),this.started){var n=V.call(this,t,e);e&(xt|Nt)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var Zt={touchstart:Dt,touchmove:kt,touchend:xt,touchcancel:Nt},te="touchstart touchmove touchend touchcancel";h(G,A,{handler:function(t){var e=Zt[t.type],n=K.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});var ee=2500,ne=25;h($,A,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)X.call(this,e,n);else if(i&&Y.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var re=C(gt.style,"touchAction"),ie=re!==a,oe="auto",se="manipulation",ae="none",ce="pan-x",ue="pan-y",le=function(){if(!ie)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){t[n]=!e||i.CSS.supports("touch-action",n)}),t}();Q.prototype={set:function(t){"compute"==t&&(t=this.compute()),ie&&this.manager.element.style&&le[t]&&(this.manager.element.style[re]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){p(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),J(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var r=this.actions,i=y(r,ae)&&!le[ae],o=y(r,ue)&&!le[ue],s=y(r,ce)&&!le[ce];if(i){var a=1===t.pointers.length,c=t.distance<2,u=t.deltaTime<250;if(a&&c&&u)return}return s&&o?void 0:i||o&&n&Ft||s&&n&Mt?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var fe=1,he=2,de=4,pe=8,ve=pe,ge=16;Z.prototype={defaults:{},set:function(t){return pt(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(u(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=nt(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return u(t,"dropRecognizeWith",this)?this:(t=nt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(u(t,"requireFailure",this))return this;var e=this.requireFail;return t=nt(t,this),-1===E(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(u(t,"dropRequireFailure",this))return this;t=nt(t,this);var e=E(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,r=this.state;r<pe&&e(n.options.event+tt(r)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),r>=pe&&e(n.options.event+tt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|fe)))return!1;t++}return!0},recognize:function(t){var e=pt({},t);if(!p(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(ve|ge|32)&&(this.state=fe),this.state=this.process(e),this.state&(he|de|pe|ge)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},h(rt,Z,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=e&(he|de),i=this.attrTest(t);return r&&(n&Nt||!i)?e|ge:r||i?n&xt?e|pe:e&he?e|de:he:32}}),h(it,rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ut},getTouchAction:function(){var t=this.options.direction,e=[];return t&Ft&&e.push(ue),t&Mt&&e.push(ce),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,s=t.deltaY;return i&e.direction||(e.direction&Ft?(i=0===o?Lt:o<0?jt:Rt,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===s?Lt:s<0?qt:Pt,n=s!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&he||!(this.state&he)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=et(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),h(ot,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&he)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),h(st,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||t.eventType&(xt|Nt)&&!i)this.reset();else if(t.eventType&Dt)this.reset(),this._timer=c(function(){this.state=ve,this.tryEmit()},e.time,this);else if(t.eventType&xt)return ve;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ve&&(t&&t.eventType&xt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=bt(),this.manager.emit(this.options.event,this._input)))}}),h(at,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&he)}}),h(ct,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ft|Mt,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Ft|Mt)?e=t.overallVelocity:n&Ft?e=t.overallVelocityX:n&Mt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&yt(e)>this.options.velocity&&t.eventType&xt},emit:function(t){var e=et(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),h(ut,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[se]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&Dt&&0===this.count)return this.failTimeout();if(r&&i&&n){if(t.eventType!=xt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||P(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=c(function(){this.state=ve,this.tryEmit()},e.interval,this),he):ve}return 32},failTimeout:function(){return this._timer=c(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),lt.VERSION="2.0.7",lt.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[at,{enable:!1}],[ot,{enable:!1},["rotate"]],[ct,{direction:Ft}],[it,{direction:Ft},["swipe"]],[ut],[ut,{event:"doubletap",taps:2},["tap"]],[st]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ft.prototype={set:function(t){return pt(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,r=this.recognizers,i=e.curRecognizer;(!i||i&&i.state&ve)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&n.state&(he|de|pe)&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Z)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(u(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(u(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=E(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==a&&e!==a){var n=this.handlers;return l(b(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==a){var n=this.handlers;return l(b(t),function(t){e?n[t]&&n[t].splice(E(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&dt(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&ht(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},pt(lt,{INPUT_START:Dt,INPUT_MOVE:kt,INPUT_END:xt,INPUT_CANCEL:Nt,STATE_POSSIBLE:fe,STATE_BEGAN:he,STATE_CHANGED:de,STATE_ENDED:pe,STATE_RECOGNIZED:ve,STATE_CANCELLED:ge,STATE_FAILED:32,DIRECTION_NONE:Lt,DIRECTION_LEFT:jt,DIRECTION_RIGHT:Rt,DIRECTION_UP:qt,DIRECTION_DOWN:Pt,DIRECTION_HORIZONTAL:Ft,DIRECTION_VERTICAL:Mt,DIRECTION_ALL:Ut,Manager:ft,Input:A,TouchAction:Q,TouchInput:G,MouseInput:H,PointerEventInput:W,TouchMouseInput:$,SingleTouchInput:B,Recognizer:Z,AttrRecognizer:rt,Tap:ut,Pan:it,Swipe:ct,Pinch:ot,Rotate:at,Press:st,on:g,off:m,each:l,merge:wt,extend:Et,assign:pt,inherit:h,bindFn:d,prefixed:C}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=lt,(r=function(){return lt}.call(e,n,e,t))!==a&&(t.exports=r)}(window,document)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t){return t.keys().map(t)}Object.defineProperty(e,"__esModule",{value:!0});var l=(n(7),n(3),n(8),n(9),n(10),n(11),n(12),n(13),n(14),n(15),n(16),n(18),n(19),n(20),n(0)),f=n.n(l),h=(n(5),n(21),n(22),n(23),n(2)),d=n.n(h),p=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),v=function(t){return function(){function e(){r(this,e)}return p(e,null,[{key:"show",value:function(e){t("#PageLoading").show(0,e)}},{key:"hide",value:function(e){t("#PageLoading").hide("slow",e)}}]),e}()}(f.a),g=v,m=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),_=(function(t){var e=function(){function e(){i(this,e)}return m(e,null,[{key:"each",value:function(e){t(".js-carousel").each(function(n,r){e(n,t(r))})}},{key:"init",value:function(){this.dispose(),this.each(function(e,n){var r=t(n),i="Carousel"+e;r.attr("id",i),r.data("id",e);var o=t(n).find(".carousel-item"),s=o.length;if(s){if(r.data("indicators")){var a=t('<ol class="carousel-indicators"></ol>');a.append('<li data-target="#'+i+'" data-slide-to="0" class="active"></li>');for(var c=1;c<s;c++)a.append('<li data-target="#'+i+'" data-slide-to="'+c+'"></li>');r.prepend(a)}r.data("arrows")&&(r.prepend('<i class="carousel-control-prev" data-target="#'+i+'" role="button" data-slide="prev"><i class="fas fa-chevron-left" aria-hidden="true"></i><i class="sr-only">Previous</i></i>'),r.prepend('<i class="carousel-control-next" data-target="#'+i+'" role="button" data-slide="next"><i class="fas fa-chevron-right" aria-hidden="true"></i><i class="sr-only">Next</i></i>')),r.carousel(),r.hammer().bind("swipeleft",function(e){t(e.target).carousel("next")}),r.hammer().bind("swiperight",function(e){t(e.target).carousel("prev")}),r.hammer().bind("panleft",function(e){t(e.target).carousel("next")}),r.hammer().bind("panright",function(e){t(e.target).carousel("prev")}),r.hammer().bind("tap",function(e){t(e.target).carousel("next")})}})}},{key:"dispose",value:function(){this.each(function(e,n){t(n).carousel("dispose")})}}]),e}();t(window).on(d.a.AJAX+" "+d.a.LOADED,function(){e.init()})}(f.a),function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()),y=(function(t){var e="jsSlidingMenu",n=e,r=function(){function r(n){o(this,r),this._element=n;var i=t(this._element);i.addClass(e+"-active"),t(window).on("keyup",function(t){27===t.which&&i.find('.is-open[data-toggle="offcanvas"]').click()})}return _(r,[{key:"dispose",value:function(){console.log("Disposing: "+e+" elements"),t(this._element).removeClass(e+"-active"),t.removeData(this._element,n),this._element=null}}],[{key:"_jQueryInterface",value:function(){return this.each(function(){var e=t(this),i=e.data(n);i||(i=new r(this),e.data(n,i))})}}]),r}();t.fn[e]=r._jQueryInterface,t.fn[e].Constructor=r,t.fn[e].noConflict=function(){return t.fn[e]=JQUERY_NO_CONFLICT,r._jQueryInterface},t(".ui."+e).ready(function(){t(".ui."+e).jsSlidingMenu()})}(f.a),function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()),b=(function(t){var e="jsFormStorage",n=e,r=window.localStorage,i=function(){function i(o){s(this,i),this._element=o;var a=t(this._element),c=a.find("input,textarea");a.addClass(e+"-active"),c.each(function(){var n=t(this).attr("id"),i=t(this).attr("type"),o=r.getItem(e+n);n&&o&&i&&(!i||"checkbox"!==i&&"radio"!==i?t(this).val(o):t(this).prop("checked",o))}),c.change(function(){var n=t(this).attr("id"),i=t(this).attr("type"),o=t(this).val();!i||"checkbox"!==i&&"radio"!==i||(o=!!t(this).is(":checked")),n&&i&&"password"!==i&&r.setItem(e+n,o)}),a.submit(function(){a.data(n).clear()}),a.find('button,[type="submit"],[type="clear"]').click(function(){a.data(n).clear()})}return y(i,[{key:"dispose",value:function(){t(this._element).removeClass(e+"-active"),t.removeData(this._element,n),this._element=null}},{key:"clear",value:function(){r.clear()}}],[{key:"_jQueryInterface",value:function(){if(void 0!==window.localStorage)return this.each(function(){var e=t(this),r=e.data(n);r||(r=new i(this),e.data(n,r))})}}]),i}();t.fn[e]=i._jQueryInterface,t.fn[e].Constructor=i,t.fn[e].noConflict=function(){return t.fn[e]=JQUERY_NO_CONFLICT,i._jQueryInterface},t(window).on(d.a.AJAX+" "+d.a.LOADED,function(){t("form").jsFormStorage()})}(f.a),"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}),E=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),w=function(t){var e=window,n=document,r=t("html"),i=t("body"),o="jsAjaxUI",s=o,c=function(){function r(e){a(this,r),this._element=e;var n=t(this._element);n.addClass(o+"-active"),n.bind("click",function(e){e.preventDefault();var n=t(this);t(".ajax").each(function(){var e=t(this);e.removeClass("active"),e.parents(".nav-item").removeClass("active")}),n.addClass("loading"),r.load(n.attr("href"),function(){n.removeClass("loading"),n.parents(".nav-item").addClass("active"),n.addClass("active")})})}return E(r,[{key:"dispose",value:function(){t(this._element).removeClass(o+"-active"),t.removeData(this._element,s),this._element=null}}],[{key:"load",value:function(n,o){g.show(function(){i.removeClass("loaded")}),e.MainUI.updateLocation(n);var s=e.URLDetails.base+e.URLDetails.relative.substring(1);s!==e.location.href&&e.history.pushState({ajax:!0,page:s},document.title,s),t.ajax({sync:!1,async:!0,url:n,dataType:"json",method:"GET",cache:!1,error:function(t){console.warn("AJAX request failure: "+t.statusText),e.location.href=n,"function"==typeof e.ga&&e.ga("send","event","error","AJAX ERROR",t.statusText)},success:function(t,n,i){r.process(t,i,o),"function"==typeof e.ga&&(e.ga("set",{page:e.URLDetails.relative+e.URLDetails.hash,title:i.getResponseHeader("X-Title")}),e.ga("send","pageview"))}})}},{key:"process",value:function(o,s,a){var c=this,u=s.getResponseHeader("X-Include-CSS").split(",")||[],l=s.getResponseHeader("X-Include-JS").split(",")||[];if("object"===b(o.regions))for(var f in o.regions)"string"==typeof o.regions[f]&&r.replaceRegion(o.regions[f],f);t('link[type="text/css"]').each(function(){var e=u.indexOf(t(this).attr("href"));e>-1?u.splice(e,1):i.data("unload-blocked")||(console.log("Unloading: "+t(this).attr("href")),t(this).remove())}),t('script[type="text/javascript"]').each(function(){var e=l.indexOf(t(this).attr("src"));e>-1?l.splice(e,1):i.data("unload-blocked")||(console.log("Unloading: "+t(this).attr("src")),t(this).remove())}),this.preload(u).then(function(){var r=t("head");u.forEach(function(t){r.append('<link rel="stylesheet" type="text/css" href="'+t+'" />')}),c.preload(l,"script").then(function(){if(l.forEach(function(t){i.append('<script type="text/javascript" charset="UTF-8" src="'+t+'"><\/script>')}),console.log("New page is loaded!"),"object"===b(o.events))for(var r in o.events)t(n).trigger(r,[o.events[r]]);void 0!==a&&a(),t(e).trigger(d.a.AJAX)})})}},{key:"preload",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e.length)return t.Deferred().resolve().promise();var i=[];return e.forEach(function(e){var o=t.Deferred();t.ajax({dataType:n,cache:r,url:e}).always(function(){o.resolve()}),i.push(o)}),t.when.apply(t,i)}},{key:"replaceRegion",value:function(e,n){var r=t('[data-ajax-region="'+n+'"]');r.length?r.empty().append(e):console.warn("Region returned without class or id!")}},{key:"_jQueryInterface",value:function(){return this.each(function(){var e=t(this),n=e.data(s);n||(n=new r(this),e.data(s,n))})}}]),r}();return t.fn[o]=c._jQueryInterface,t.fn[o].Constructor=c,t.fn[o].noConflict=function(){return t.fn[o]=JQUERY_NO_CONFLICT,c._jQueryInterface},t(".ajax").ready(function(){t(".ajax").jsAjaxUI()}),t(n).on("layoutRefresh",function(t,e){n.title=e.Title,r.attr("class",""),e.ClassName&&r.addClass(e.ClassName)}),e.onpopstate=function(r){var i=t('a[href^="'+n.location+'"]');null!==r.state&&r.state.ajax?(console.log("GOBACK (AJAX state)"),c.load(r.state.page)):i.length&&i.hasClass("ajax")?(console.log("GOBACK (AJAX link)"),i.trigger("click")):(console.log("GOBACK (HTTP)"),e.location.href=n.location)},c}(f.a),T=w,C=n(27),S=n.n(C),O=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),A=S()();(function(t){var e=window,n=document,r=t("body"),i=t("#AlertNotify"),o=t("#SiteWideMessage");n.addEventListener("visibilitychange",function(){"hidden"===n.visibilityState?(console.log("Tab: hidden"),r.addClass("is-hidden"),r.trigger("tabHidden")):(console.log("Tab: focused"),r.removeClass("is-hidden"),r.trigger("tabFocused"))});var s=function(){navigator.onLine?(console.log("Tab: online"),r.removeClass("is-offline"),r.trigger("online")):(console.log("Tab: offline"),r.addClass("is-offline"),r.trigger("offline"))};void 0!==navigator.onLine&&(e.addEventListener("offline",function(){s()},!1),e.addEventListener("online",function(){s()},!1),e.addEventListener("load",function(){s()}));var a=function(t,e){A.animateScroll(n.querySelector(e),t,{speed:500,offset:-20})};setInterval(function(){r.hasClass("is-offline")||t.ajax({sync:!1,async:!0,cache:!1,url:"/Security/ping",global:!1,type:"POST",complete:function(t,n){"success"!==n&&e.location.reload(!1)}})},3e5),e.URLDetails={base:t("base").attr("href"),relative:"/",hash:""};var u=function(){function s(){c(this,s)}return O(s,null,[{key:"init",value:function(){this.dispose(),console.log("Initializing: MainUI"),this.updateLocation(),"caches"in e&&t("a.offline").addClass("offline-available"),this.loadImages(),t('a.external,a[rel="external"]').attr("target","_blank"),t(n).on("click",".js-scrollTo",function(e){e.preventDefault(),a(this,t(this).attr("data-target"))}),t("[data-extfont]").length&&t.getScript("//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js",function(){var n=[];t("[data-extfont]").each(function(e){n[e]=t(this).attr("data-extfont")}),e.WebFont.load({google:{families:n}})}),g.hide(function(){r.addClass("loaded")}),e.URLDetails.hash.indexOf("printpage")>-1&&e.print()}},{key:"updateLocation",value:function(t){var n=t||e.location.href;n=n.replace(e.URLDetails.base,"/");var r=n.indexOf("#");e.URLDetails.relative=n.split("#")[0],e.URLDetails.hash=r>=0?n.substr(n.indexOf("#")):""}},{key:"alert",value:function(n,r){o.fadeOut("fast"),o.html('<div class="page-alert"><div class="alert alert-'+r+'"><i class="close" data-dismiss="alert">&times;</i>'+n+"</div></div>"),o.find(".page-alert").alert(),o.find('.close[data-dismiss="alert"]').click(function(){o.fadeOut("slow",function(){o.find(".page-alert").alert("close")})}),o.fadeIn("slow"),i.length&&i[0].play(),t(e).trigger("alert-appeared")}},{key:"alertHide",value:function(){0!==o.length&&o.fadeOut("slow",function(){o.find(".alert").alert("close")}),i.length&&void 0!==i[0].stop&&i[0].stop(),t(e).trigger("alert-removed")}},{key:"loadImages",value:function(){var n=r.find("img"),i=[],o=[];n.each(function(){var e=t(this).attr("src"),n=t(this).data("lazy-src");e.length&&i.push(e),n&&o.push(n)}),T.preload(i).then(function(){t(e).trigger("images-loaded"),T.preload(o).then(function(){t("img[data-lazy-src]").each(function(){t(this).attr("src")&&t(this).attr("src",t(this).data("lazy-src"))}),console.log("All images are loaded!"),t(e).trigger("images-lazy-loaded")})})}},{key:"dispose",value:function(){console.log("Destroying: MainUI")}}]),s}();t(e).on(d.a.AJAX+" "+d.a.LOADED,function(){u.init()}),e.MainUI=u})(f.a),u(n(28)),u(n(32))},function(t,e){},function(t,e,n){(function(t){!function(t){function e(t){return{}.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase()}function n(){return{bindType:i,delegateType:i,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}}function r(e){var n=this,r=!1;return t(this).one(o.TRANSITION_END,function(){r=!0}),setTimeout(function(){r||o.triggerTransitionEnd(n)},e),this}var i="transitionend",o={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(e){var n=e.getAttribute("data-target");n&&"#"!==n||(n=e.getAttribute("href")||"");try{return t(document).find(n).length>0?n:null}catch(t){return null}},getTransitionDurationFromElement:function(e){if(!e)return 0;var n=t(e).css("transition-duration");return parseFloat(n)?(n=n.split(",")[0],1e3*parseFloat(n)):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(i)},supportsTransitionEnd:function(){return Boolean(i)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,n,r){for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i],a=n[i],c=a&&o.isElement(a)?"element":e(a);if(!new RegExp(s).test(c))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+c+'" but expected type "'+s+'".')}}};!function(){t.fn.emulateTransitionEnd=r,t.event.special[o.TRANSITION_END]=n()}()}(t)}).call(e,n(0))},function(t,e,n){(function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}!function(t){var n="alert",i=t.fn[n],o={DISMISS:'[data-dismiss="alert"]'},s={CLOSE:"close.bs.alert",CLOSED:"closed.bs.alert",CLICK_DATA_API:"click.bs.alert.data-api"},a={ALERT:"alert",FADE:"fade",SHOW:"show"},c=function(){function n(t){this._element=t}var i=n.prototype;return i.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},i.dispose=function(){t.removeData(this._element,"bs.alert"),this._element=null},i._getRootElement=function(n){var r=e.getSelectorFromElement(n),i=!1;return r&&(i=t(r)[0]),i||(i=t(n).closest("."+a.ALERT)[0]),i},i._triggerCloseEvent=function(e){var n=t.Event(s.CLOSE);return t(e).trigger(n),n},i._removeElement=function(n){var r=this;if(t(n).removeClass(a.SHOW),!t(n).hasClass(a.FADE))return void this._destroyElement(n);var i=e.getTransitionDurationFromElement(n);t(n).one(e.TRANSITION_END,function(t){return r._destroyElement(n,t)}).emulateTransitionEnd(i)},i._destroyElement=function(e){t(e).detach().trigger(s.CLOSED).remove()},n._jQueryInterface=function(e){return this.each(function(){var r=t(this),i=r.data("bs.alert");i||(i=new n(this),r.data("bs.alert",i)),"close"===e&&i[e](this)})},n._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},r(n,null,[{key:"VERSION",get:function(){return"4.1.1"}}]),n}();t(document).on(s.CLICK_DATA_API,o.DISMISS,c._handleDismiss(new c)),t.fn[n]=c._jQueryInterface,t.fn[n].Constructor=c,t.fn[n].noConflict=function(){return t.fn[n]=i,c._jQueryInterface}}(t)}).call(e,n(0),n(1))},function(t,e,n){(function(t){function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}!function(t){var e="button",r=t.fn[e],i={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},o={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},s={CLICK_DATA_API:"click.bs.button.data-api",FOCUS_BLUR_DATA_API:"focus.bs.button.data-api blur.bs.button.data-api"},a=function(){function e(t){this._element=t}var r=e.prototype;return r.toggle=function(){var e=!0,n=!0,r=t(this._element).closest(o.DATA_TOGGLE)[0];if(r){var s=t(this._element).find(o.INPUT)[0];if(s){if("radio"===s.type)if(s.checked&&t(this._element).hasClass(i.ACTIVE))e=!1;else{var a=t(r).find(o.ACTIVE)[0];a&&t(a).removeClass(i.ACTIVE)}if(e){if(s.hasAttribute("disabled")||r.hasAttribute("disabled")||s.classList.contains("disabled")||r.classList.contains("disabled"))return;s.checked=!t(this._element).hasClass(i.ACTIVE),t(s).trigger("change")}s.focus(),n=!1}}n&&this._element.setAttribute("aria-pressed",!t(this._element).hasClass(i.ACTIVE)),e&&t(this._element).toggleClass(i.ACTIVE)},r.dispose=function(){t.removeData(this._element,"bs.button"),this._element=null},e._jQueryInterface=function(n){return this.each(function(){var r=t(this).data("bs.button");r||(r=new e(this),t(this).data("bs.button",r)),"toggle"===n&&r[n]()})},n(e,null,[{key:"VERSION",get:function(){return"4.1.1"}}]),e}();t(document).on(s.CLICK_DATA_API,o.DATA_TOGGLE_CARROT,function(e){e.preventDefault();var n=e.target;t(n).hasClass(i.BUTTON)||(n=t(n).closest(o.BUTTON)),a._jQueryInterface.call(t(n),"toggle")}).on(s.FOCUS_BLUR_DATA_API,o.DATA_TOGGLE_CARROT,function(e){var n=t(e.target).closest(o.BUTTON)[0];t(n).toggleClass(i.FOCUS,/^focus(in)?$/.test(e.type))}),t.fn[e]=a._jQueryInterface,t.fn[e].Constructor=a,t.fn[e].noConflict=function(){return t.fn[e]=r,a._jQueryInterface}}(t)}).call(e,n(0))},function(t,e,n){(function(t,e){function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}!function(t){var r="carousel",i="bs.carousel",s="."+i,a=t.fn[r],c={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},u={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},l={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},f={SLIDE:"slide"+s,SLID:"slid"+s,KEYDOWN:"keydown"+s,MOUSEENTER:"mouseenter"+s,MOUSELEAVE:"mouseleave"+s,TOUCHEND:"touchend"+s,LOAD_DATA_API:"load.bs.carousel.data-api",CLICK_DATA_API:"click.bs.carousel.data-api"},h={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},d={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},p=function(){function a(e,n){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(n),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(d.INDICATORS)[0],this._addEventListeners()}var p=a.prototype;return p.next=function(){this._isSliding||this._slide(l.NEXT)},p.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},p.prev=function(){this._isSliding||this._slide(l.PREV)},p.pause=function(n){n||(this._isPaused=!0),t(this._element).find(d.NEXT_PREV)[0]&&(e.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},p.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},p.to=function(e){var n=this;this._activeElement=t(this._element).find(d.ACTIVE_ITEM)[0];var r=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0)){if(this._isSliding)return void t(this._element).one(f.SLID,function(){return n.to(e)});if(r===e)return this.pause(),void this.cycle();var i=e>r?l.NEXT:l.PREV;this._slide(i,this._items[e])}},p.dispose=function(){t(this._element).off(s),t.removeData(this._element,i),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},p._getConfig=function(t){return t=n({},c,t),e.typeCheckConfig(r,t,u),t},p._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(f.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(f.MOUSEENTER,function(t){return e.pause(t)}).on(f.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(f.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},p._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},p._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(d.ITEM)),this._items.indexOf(e)},p._getItemByDirection=function(t,e){var n=t===l.NEXT,r=t===l.PREV,i=this._getItemIndex(e),o=this._items.length-1;if((r&&0===i||n&&i===o)&&!this._config.wrap)return e;var s=t===l.PREV?-1:1,a=(i+s)%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},p._triggerSlideEvent=function(e,n){var r=this._getItemIndex(e),i=this._getItemIndex(t(this._element).find(d.ACTIVE_ITEM)[0]),o=t.Event(f.SLIDE,{relatedTarget:e,direction:n,from:i,to:r});return t(this._element).trigger(o),o},p._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(d.ACTIVE).removeClass(h.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(h.ACTIVE)}},p._slide=function(n,r){var i,o,s,a=this,c=t(this._element).find(d.ACTIVE_ITEM)[0],u=this._getItemIndex(c),p=r||c&&this._getItemByDirection(n,c),v=this._getItemIndex(p),g=Boolean(this._interval);if(n===l.NEXT?(i=h.LEFT,o=h.NEXT,s=l.LEFT):(i=h.RIGHT,o=h.PREV,s=l.RIGHT),p&&t(p).hasClass(h.ACTIVE))return void(this._isSliding=!1);if(!this._triggerSlideEvent(p,s).isDefaultPrevented()&&c&&p){this._isSliding=!0,g&&this.pause(),this._setActiveIndicatorElement(p);var m=t.Event(f.SLID,{relatedTarget:p,direction:s,from:u,to:v});if(t(this._element).hasClass(h.SLIDE)){t(p).addClass(o),e.reflow(p),t(c).addClass(i),t(p).addClass(i);var _=e.getTransitionDurationFromElement(c);t(c).one(e.TRANSITION_END,function(){t(p).removeClass(i+" "+o).addClass(h.ACTIVE),t(c).removeClass(h.ACTIVE+" "+o+" "+i),a._isSliding=!1,setTimeout(function(){return t(a._element).trigger(m)},0)}).emulateTransitionEnd(_)}else t(c).removeClass(h.ACTIVE),t(p).addClass(h.ACTIVE),this._isSliding=!1,t(this._element).trigger(m);g&&this.cycle()}},a._jQueryInterface=function(e){return this.each(function(){var r=t(this).data(i),o=n({},c,t(this).data());"object"==typeof e&&(o=n({},o,e));var s="string"==typeof e?e:o.slide;if(r||(r=new a(this,o),t(this).data(i,r)),"number"==typeof e)r.to(e);else if("string"==typeof s){if(void 0===r[s])throw new TypeError('No method named "'+s+'"');r[s]()}else o.interval&&(r.pause(),r.cycle())})},a._dataApiClickHandler=function(r){var o=e.getSelectorFromElement(this);if(o){var s=t(o)[0];if(s&&t(s).hasClass(h.CAROUSEL)){var c=n({},t(s).data(),t(this).data()),u=this.getAttribute("data-slide-to");u&&(c.interval=!1),a._jQueryInterface.call(t(s),c),u&&t(s).data(i).to(u),r.preventDefault()}}},o(a,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return c}}]),a}();t(document).on(f.CLICK_DATA_API,d.DATA_SLIDE,p._dataApiClickHandler),t(window).on(f.LOAD_DATA_API,function(){t(d.DATA_RIDE).each(function(){var e=t(this);p._jQueryInterface.call(e,e.data())})}),t.fn[r]=p._jQueryInterface,t.fn[r].Constructor=p,t.fn[r].noConflict=function(){return t.fn[r]=a,p._jQueryInterface}}(t)}).call(e,n(0),n(1))},function(t,e,n){(function(t,e){function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}!function(t){var r="collapse",i="bs.collapse",s=t.fn[r],a={toggle:!0,parent:""},c={toggle:"boolean",parent:"(string|element)"},u={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK_DATA_API:"click.bs.collapse.data-api"},l={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},f={WIDTH:"width",HEIGHT:"height"},h={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},d=function(){function s(n,r){this._isTransitioning=!1,this._element=n,this._config=this._getConfig(r),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+n.id+'"],[data-toggle="collapse"][data-target="#'+n.id+'"]'));for(var i=t(h.DATA_TOGGLE),o=0;o<i.length;o++){var s=i[o],a=e.getSelectorFromElement(s);null!==a&&t(a).filter(n).length>0&&(this._selector=a,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var d=s.prototype;return d.toggle=function(){t(this._element).hasClass(l.SHOW)?this.hide():this.show()},d.show=function(){var n=this;if(!this._isTransitioning&&!t(this._element).hasClass(l.SHOW)){var r,o;if(this._parent&&(r=t.makeArray(t(this._parent).find(h.ACTIVES).filter('[data-parent="'+this._config.parent+'"]')),0===r.length&&(r=null)),!(r&&(o=t(r).not(this._selector).data(i))&&o._isTransitioning)){var a=t.Event(u.SHOW);if(t(this._element).trigger(a),!a.isDefaultPrevented()){r&&(s._jQueryInterface.call(t(r).not(this._selector),"hide"),o||t(r).data(i,null));var c=this._getDimension();t(this._element).removeClass(l.COLLAPSE).addClass(l.COLLAPSING),this._element.style[c]=0,this._triggerArray.length>0&&t(this._triggerArray).removeClass(l.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var f=function(){t(n._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).addClass(l.SHOW),n._element.style[c]="",n.setTransitioning(!1),t(n._element).trigger(u.SHOWN)},d=c[0].toUpperCase()+c.slice(1),p="scroll"+d,v=e.getTransitionDurationFromElement(this._element);t(this._element).one(e.TRANSITION_END,f).emulateTransitionEnd(v),this._element.style[c]=this._element[p]+"px"}}}},d.hide=function(){var n=this;if(!this._isTransitioning&&t(this._element).hasClass(l.SHOW)){var r=t.Event(u.HIDE);if(t(this._element).trigger(r),!r.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",e.reflow(this._element),t(this._element).addClass(l.COLLAPSING).removeClass(l.COLLAPSE).removeClass(l.SHOW),this._triggerArray.length>0)for(var o=0;o<this._triggerArray.length;o++){var s=this._triggerArray[o],a=e.getSelectorFromElement(s);if(null!==a){var c=t(a);c.hasClass(l.SHOW)||t(s).addClass(l.COLLAPSED).attr("aria-expanded",!1)}}this.setTransitioning(!0);var f=function(){n.setTransitioning(!1),t(n._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).trigger(u.HIDDEN)};this._element.style[i]="";var h=e.getTransitionDurationFromElement(this._element);t(this._element).one(e.TRANSITION_END,f).emulateTransitionEnd(h)}}},d.setTransitioning=function(t){this._isTransitioning=t},d.dispose=function(){t.removeData(this._element,i),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},d._getConfig=function(t){return t=n({},a,t),t.toggle=Boolean(t.toggle),e.typeCheckConfig(r,t,c),t},d._getDimension=function(){return t(this._element).hasClass(f.WIDTH)?f.WIDTH:f.HEIGHT},d._getParent=function(){var n=this,r=null;e.isElement(this._config.parent)?(r=this._config.parent,void 0!==this._config.parent.jquery&&(r=this._config.parent[0])):r=t(this._config.parent)[0];var i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(r).find(i).each(function(t,e){n._addAriaAndCollapsedClass(s._getTargetFromElement(e),[e])}),r},d._addAriaAndCollapsedClass=function(e,n){if(e){var r=t(e).hasClass(l.SHOW);n.length>0&&t(n).toggleClass(l.COLLAPSED,!r).attr("aria-expanded",r)}},s._getTargetFromElement=function(n){var r=e.getSelectorFromElement(n);return r?t(r)[0]:null},s._jQueryInterface=function(e){return this.each(function(){var r=t(this),o=r.data(i),c=n({},a,r.data(),"object"==typeof e&&e?e:{});if(!o&&c.toggle&&/show|hide/.test(e)&&(c.toggle=!1),o||(o=new s(this,c),r.data(i,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}})},o(s,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return a}}]),s}();t(document).on(u.CLICK_DATA_API,h.DATA_TOGGLE,function(n){"A"===n.currentTarget.tagName&&n.preventDefault();var r=t(this),o=e.getSelectorFromElement(this);t(o).each(function(){var e=t(this),n=e.data(i),o=n?"toggle":r.data();d._jQueryInterface.call(e,o)})}),t.fn[r]=d._jQueryInterface,t.fn[r].Constructor=d,t.fn[r].noConflict=function(){return t.fn[r]=s,d._jQueryInterface}}(t)}).call(e,n(0),n(1))},function(t,e,n){(function(t,e,n){function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){i(t,e,n[e])})}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}!function(t){var i="dropdown",o="bs.dropdown",a="."+o,c=t.fn[i],u=new RegExp("38|40|27"),l={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click.bs.dropdown.data-api",KEYDOWN_DATA_API:"keydown.bs.dropdown.data-api",KEYUP_DATA_API:"keyup.bs.dropdown.data-api"},f={DISABLED:"disabled",SHOW:"show",DROPUP:"dropup",DROPRIGHT:"dropright",DROPLEFT:"dropleft",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",POSITION_STATIC:"position-static"},h={DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",MENU:".dropdown-menu",NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)"},d={TOP:"top-start",TOPEND:"top-end",BOTTOM:"bottom-start",BOTTOMEND:"bottom-end",RIGHT:"right-start",RIGHTEND:"right-end",LEFT:"left-start",LEFTEND:"left-end"},p={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},v={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},g=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var g=c.prototype;return g.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(f.DISABLED)){var r=c._getParentFromElement(this._element),i=t(this._menu).hasClass(f.SHOW);if(c._clearMenus(),!i){var o={relatedTarget:this._element},s=t.Event(l.SHOW,o);if(t(r).trigger(s),!s.isDefaultPrevented()){if(!this._inNavbar){if(void 0===e)throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var a=this._element;"parent"===this._config.reference?a=r:n.isElement(this._config.reference)&&(a=this._config.reference,void 0!==this._config.reference.jquery&&(a=this._config.reference[0])),"scrollParent"!==this._config.boundary&&t(r).addClass(f.POSITION_STATIC),this._popper=new e(a,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===t(r).closest(h.NAVBAR_NAV).length&&t(document.body).children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(f.SHOW),t(r).toggleClass(f.SHOW).trigger(t.Event(l.SHOWN,o))}}}},g.dispose=function(){t.removeData(this._element,o),t(this._element).off(a),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},g.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},g._addEventListeners=function(){var e=this;t(this._element).on(l.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},g._getConfig=function(e){return e=r({},this.constructor.Default,t(this._element).data(),e),n.typeCheckConfig(i,e,this.constructor.DefaultType),e},g._getMenuElement=function(){if(!this._menu){var e=c._getParentFromElement(this._element);this._menu=t(e).find(h.MENU)[0]}return this._menu},g._getPlacement=function(){var e=t(this._element).parent(),n=d.BOTTOM;return e.hasClass(f.DROPUP)?(n=d.TOP,t(this._menu).hasClass(f.MENURIGHT)&&(n=d.TOPEND)):e.hasClass(f.DROPRIGHT)?n=d.RIGHT:e.hasClass(f.DROPLEFT)?n=d.LEFT:t(this._menu).hasClass(f.MENURIGHT)&&(n=d.BOTTOMEND),n},g._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},g._getPopperConfig=function(){var t=this,e={};"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets)||{}),e}:e.offset=this._config.offset;var n={placement:this._getPlacement(),modifiers:{offset:e,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(n.modifiers.applyStyle={enabled:!1}),n},c._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(o),r="object"==typeof e?e:null;if(n||(n=new c(this,r),t(this).data(o,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},c._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(h.DATA_TOGGLE)),r=0;r<n.length;r++){var i=c._getParentFromElement(n[r]),s=t(n[r]).data(o),a={relatedTarget:n[r]};if(s){var u=s._menu;if(t(i).hasClass(f.SHOW)&&!(e&&("click"===e.type&&/input|textarea/i.test(e.target.tagName)||"keyup"===e.type&&9===e.which)&&t.contains(i,e.target))){var d=t.Event(l.HIDE,a);t(i).trigger(d),d.isDefaultPrevented()||("ontouchstart"in document.documentElement&&t(document.body).children().off("mouseover",null,t.noop),n[r].setAttribute("aria-expanded","false"),t(u).removeClass(f.SHOW),t(i).removeClass(f.SHOW).trigger(t.Event(l.HIDDEN,a)))}}}},c._getParentFromElement=function(e){var r,i=n.getSelectorFromElement(e);return i&&(r=t(i)[0]),r||e.parentNode},c._dataApiKeydownHandler=function(e){if((/input|textarea/i.test(e.target.tagName)?!(32===e.which||27!==e.which&&(40!==e.which&&38!==e.which||t(e.target).closest(h.MENU).length)):u.test(e.which))&&(e.preventDefault(),e.stopPropagation(),!this.disabled&&!t(this).hasClass(f.DISABLED))){var n=c._getParentFromElement(this),r=t(n).hasClass(f.SHOW);if(!r&&(27!==e.which||32!==e.which)||r&&(27===e.which||32===e.which)){if(27===e.which){var i=t(n).find(h.DATA_TOGGLE)[0];t(i).trigger("focus")}return void t(this).trigger("click")}var o=t(n).find(h.VISIBLE_ITEMS).get();if(0!==o.length){var s=o.indexOf(e.target);38===e.which&&s>0&&s--,40===e.which&&s<o.length-1&&s++,s<0&&(s=0),o[s].focus()}}},s(c,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return p}},{key:"DefaultType",get:function(){return v}}]),c}();t(document).on(l.KEYDOWN_DATA_API,h.DATA_TOGGLE,g._dataApiKeydownHandler).on(l.KEYDOWN_DATA_API,h.MENU,g._dataApiKeydownHandler).on(l.CLICK_DATA_API+" "+l.KEYUP_DATA_API,g._clearMenus).on(l.CLICK_DATA_API,h.DATA_TOGGLE,function(e){e.preventDefault(),e.stopPropagation(),g._jQueryInterface.call(t(this),"toggle")}).on(l.CLICK_DATA_API,h.FORM_CHILD,function(t){t.stopPropagation()}),t.fn[i]=g._jQueryInterface,t.fn[i].Constructor=g,t.fn[i].noConflict=function(){return t.fn[i]=c,g._jQueryInterface}}(t)}).call(e,n(0),n(3).default,n(1))},function(t,e,n){(function(t,e){function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}!function(t){var r="modal",i=t.fn[r],s={backdrop:!0,keyboard:!0,focus:!0,show:!0},a={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},c={HIDE:"hide.bs.modal",HIDDEN:"hidden.bs.modal",SHOW:"show.bs.modal",SHOWN:"shown.bs.modal",FOCUSIN:"focusin.bs.modal",RESIZE:"resize.bs.modal",CLICK_DISMISS:"click.dismiss.bs.modal",KEYDOWN_DISMISS:"keydown.dismiss.bs.modal",MOUSEUP_DISMISS:"mouseup.dismiss.bs.modal",MOUSEDOWN_DISMISS:"mousedown.dismiss.bs.modal",CLICK_DATA_API:"click.bs.modal.data-api"},u={SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",SHOW:"show"},l={DIALOG:".modal-dialog",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"},f=function(){function i(e,n){this._config=this._getConfig(n),this._element=e,this._dialog=t(e).find(l.DIALOG)[0],this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._scrollbarWidth=0}var f=i.prototype;return f.toggle=function(t){return this._isShown?this.hide():this.show(t)},f.show=function(e){var n=this;if(!this._isTransitioning&&!this._isShown){t(this._element).hasClass(u.FADE)&&(this._isTransitioning=!0);var r=t.Event(c.SHOW,{relatedTarget:e});t(this._element).trigger(r),this._isShown||r.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),t(document.body).addClass(u.OPEN),this._setEscapeEvent(),this._setResizeEvent(),t(this._element).on(c.CLICK_DISMISS,l.DATA_DISMISS,function(t){return n.hide(t)}),t(this._dialog).on(c.MOUSEDOWN_DISMISS,function(){t(n._element).one(c.MOUSEUP_DISMISS,function(e){t(e.target).is(n._element)&&(n._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return n._showElement(e)}))}},f.hide=function(n){var r=this;if(n&&n.preventDefault(),!this._isTransitioning&&this._isShown){var i=t.Event(c.HIDE);if(t(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var o=t(this._element).hasClass(u.FADE);if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),t(document).off(c.FOCUSIN),t(this._element).removeClass(u.SHOW),t(this._element).off(c.CLICK_DISMISS),t(this._dialog).off(c.MOUSEDOWN_DISMISS),o){var s=e.getTransitionDurationFromElement(this._element);t(this._element).one(e.TRANSITION_END,function(t){return r._hideModal(t)}).emulateTransitionEnd(s)}else this._hideModal()}}},f.dispose=function(){t.removeData(this._element,"bs.modal"),t(window,document,this._element,this._backdrop).off(".bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._scrollbarWidth=null},f.handleUpdate=function(){this._adjustDialog()},f._getConfig=function(t){return t=n({},s,t),e.typeCheckConfig(r,t,a),t},f._showElement=function(n){var r=this,i=t(this._element).hasClass(u.FADE);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.scrollTop=0,i&&e.reflow(this._element),t(this._element).addClass(u.SHOW),this._config.focus&&this._enforceFocus();var o=t.Event(c.SHOWN,{relatedTarget:n}),s=function(){r._config.focus&&r._element.focus(),r._isTransitioning=!1,t(r._element).trigger(o)};if(i){var a=e.getTransitionDurationFromElement(this._element);t(this._dialog).one(e.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},f._enforceFocus=function(){var e=this;t(document).off(c.FOCUSIN).on(c.FOCUSIN,function(n){document!==n.target&&e._element!==n.target&&0===t(e._element).has(n.target).length&&e._element.focus()})},f._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?t(this._element).on(c.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||t(this._element).off(c.KEYDOWN_DISMISS)},f._setResizeEvent=function(){var e=this;this._isShown?t(window).on(c.RESIZE,function(t){return e.handleUpdate(t)}):t(window).off(c.RESIZE)},f._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1,this._showBackdrop(function(){t(document.body).removeClass(u.OPEN),e._resetAdjustments(),e._resetScrollbar(),t(e._element).trigger(c.HIDDEN)})},f._removeBackdrop=function(){this._backdrop&&(t(this._backdrop).remove(),this._backdrop=null)},f._showBackdrop=function(n){var r=this,i=t(this._element).hasClass(u.FADE)?u.FADE:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=u.BACKDROP,i&&t(this._backdrop).addClass(i),t(this._backdrop).appendTo(document.body),t(this._element).on(c.CLICK_DISMISS,function(t){if(r._ignoreBackdropClick)return void(r._ignoreBackdropClick=!1);t.target===t.currentTarget&&("static"===r._config.backdrop?r._element.focus():r.hide())}),i&&e.reflow(this._backdrop),t(this._backdrop).addClass(u.SHOW),!n)return;if(!i)return void n();var o=e.getTransitionDurationFromElement(this._backdrop);t(this._backdrop).one(e.TRANSITION_END,n).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){t(this._backdrop).removeClass(u.SHOW);var s=function(){r._removeBackdrop(),n&&n()};if(t(this._element).hasClass(u.FADE)){var a=e.getTransitionDurationFromElement(this._backdrop);t(this._backdrop).one(e.TRANSITION_END,s).emulateTransitionEnd(a)}else s()}else n&&n()},f._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},f._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},f._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},f._setScrollbar=function(){var e=this;if(this._isBodyOverflowing){t(l.FIXED_CONTENT).each(function(n,r){var i=t(r)[0].style.paddingRight,o=t(r).css("padding-right");t(r).data("padding-right",i).css("padding-right",parseFloat(o)+e._scrollbarWidth+"px")}),t(l.STICKY_CONTENT).each(function(n,r){var i=t(r)[0].style.marginRight,o=t(r).css("margin-right");t(r).data("margin-right",i).css("margin-right",parseFloat(o)-e._scrollbarWidth+"px")}),t(l.NAVBAR_TOGGLER).each(function(n,r){var i=t(r)[0].style.marginRight,o=t(r).css("margin-right");t(r).data("margin-right",i).css("margin-right",parseFloat(o)+e._scrollbarWidth+"px")});var n=document.body.style.paddingRight,r=t(document.body).css("padding-right");t(document.body).data("padding-right",n).css("padding-right",parseFloat(r)+this._scrollbarWidth+"px")}},f._resetScrollbar=function(){t(l.FIXED_CONTENT).each(function(e,n){var r=t(n).data("padding-right");void 0!==r&&t(n).css("padding-right",r).removeData("padding-right")}),t(l.STICKY_CONTENT+", "+l.NAVBAR_TOGGLER).each(function(e,n){var r=t(n).data("margin-right");void 0!==r&&t(n).css("margin-right",r).removeData("margin-right")});var e=t(document.body).data("padding-right");void 0!==e&&t(document.body).css("padding-right",e).removeData("padding-right")},f._getScrollbarWidth=function(){var t=document.createElement("div");t.className=u.SCROLLBAR_MEASURER,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},i._jQueryInterface=function(e,r){return this.each(function(){var o=t(this).data("bs.modal"),a=n({},s,t(this).data(),"object"==typeof e&&e?e:{});if(o||(o=new i(this,a),t(this).data("bs.modal",o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e](r)}else a.show&&o.show(r)})},o(i,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return s}}]),i}();t(document).on(c.CLICK_DATA_API,l.DATA_TOGGLE,function(r){var i,o=this,s=e.getSelectorFromElement(this);s&&(i=t(s)[0]);var a=t(i).data("bs.modal")?"toggle":n({},t(i).data(),t(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||r.preventDefault();var u=t(i).one(c.SHOW,function(e){e.isDefaultPrevented()||u.one(c.HIDDEN,function(){t(o).is(":visible")&&o.focus()})});f._jQueryInterface.call(t(i),a,this)}),t.fn[r]=f._jQueryInterface,t.fn[r].Constructor=f,t.fn[r].noConflict=function(){return t.fn[r]=i,f._jQueryInterface}}(t)}).call(e,n(0),n(1))},function(t,e,n){(function(t,e,n){function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){i(t,e,n[e])})}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}!function(t){var i="tooltip",o=".bs.tooltip",a=t.fn[i],c=new RegExp("(^|\\s)bs-tooltip\\S+","g"),u={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)"},l={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},f={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},h={SHOW:"show",OUT:"out"},d={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},p={FADE:"fade",SHOW:"show"},v={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner",ARROW:".arrow"},g={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},m=function(){function a(t,n){if(void 0===e)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(n),this.tip=null,this._setListeners()}var m=a.prototype;return m.enable=function(){this._isEnabled=!0},m.disable=function(){this._isEnabled=!1},m.toggleEnabled=function(){this._isEnabled=!this._isEnabled},m.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,r=t(e.currentTarget).data(n);r||(r=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,r)),r._activeTrigger.click=!r._activeTrigger.click,r._isWithActiveTrigger()?r._enter(null,r):r._leave(null,r)}else{if(t(this.getTipElement()).hasClass(p.SHOW))return void this._leave(null,this);this._enter(null,this)}},m.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},m.show=function(){var r=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var i=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(i);var o=t.contains(this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!o)return;var s=this.getTipElement(),a=n.getUID(this.constructor.NAME);s.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&t(s).addClass(p.FADE);var c="function"==typeof this.config.placement?this.config.placement.call(this,s,this.element):this.config.placement,u=this._getAttachment(c);this.addAttachmentClass(u);var l=!1===this.config.container?document.body:t(this.config.container);t(s).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(s).appendTo(l),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new e(this.element,s,{placement:u,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:v.ARROW},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&r._handlePopperPlacementChange(t)},onUpdate:function(t){r._handlePopperPlacementChange(t)}}),t(s).addClass(p.SHOW),"ontouchstart"in document.documentElement&&t(document.body).children().on("mouseover",null,t.noop);var f=function(){r.config.animation&&r._fixTransition();var e=r._hoverState;r._hoverState=null,t(r.element).trigger(r.constructor.Event.SHOWN),e===h.OUT&&r._leave(null,r)};if(t(this.tip).hasClass(p.FADE)){var d=n.getTransitionDurationFromElement(this.tip);t(this.tip).one(n.TRANSITION_END,f).emulateTransitionEnd(d)}else f()}},m.hide=function(e){var r=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE),s=function(){r._hoverState!==h.SHOW&&i.parentNode&&i.parentNode.removeChild(i),r._cleanTipClass(),r.element.removeAttribute("aria-describedby"),t(r.element).trigger(r.constructor.Event.HIDDEN),null!==r._popper&&r._popper.destroy(),e&&e()};if(t(this.element).trigger(o),!o.isDefaultPrevented()){if(t(i).removeClass(p.SHOW),"ontouchstart"in document.documentElement&&t(document.body).children().off("mouseover",null,t.noop),this._activeTrigger[g.CLICK]=!1,this._activeTrigger[g.FOCUS]=!1,this._activeTrigger[g.HOVER]=!1,t(this.tip).hasClass(p.FADE)){var a=n.getTransitionDurationFromElement(i);t(i).one(n.TRANSITION_END,s).emulateTransitionEnd(a)}else s();this._hoverState=""}},m.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},m.isWithContent=function(){return Boolean(this.getTitle())},m.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},m.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},m.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(v.TOOLTIP_INNER),this.getTitle()),e.removeClass(p.FADE+" "+p.SHOW)},m.setElementContent=function(e,n){var r=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?r?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[r?"html":"text"](n)},m.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},m._getAttachment=function(t){return l[t.toUpperCase()]},m._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==g.MANUAL){var r=n===g.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,i=n===g.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(r,e.config.selector,function(t){return e._enter(t)}).on(i,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},m._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},m._enter=function(e,n){var r=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(r),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(r,n)),e&&(n._activeTrigger["focusin"===e.type?g.FOCUS:g.HOVER]=!0),t(n.getTipElement()).hasClass(p.SHOW)||n._hoverState===h.SHOW?void(n._hoverState=h.SHOW):(clearTimeout(n._timeout),n._hoverState=h.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===h.SHOW&&n.show()},n.config.delay.show)):void n.show())},m._leave=function(e,n){var r=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(r),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(r,n)),e&&(n._activeTrigger["focusout"===e.type?g.FOCUS:g.HOVER]=!1),!n._isWithActiveTrigger()){if(clearTimeout(n._timeout),n._hoverState=h.OUT,!n.config.delay||!n.config.delay.hide)return void n.hide();n._timeout=setTimeout(function(){n._hoverState===h.OUT&&n.hide()},n.config.delay.hide)}},m._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},m._getConfig=function(e){return e=r({},this.constructor.Default,t(this.element).data(),"object"==typeof e&&e?e:{}),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),n.typeCheckConfig(i,e,this.constructor.DefaultType),e},m._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},m._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(c);null!==n&&n.length>0&&e.removeClass(n.join(""))},m._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},m._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p.FADE),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.tooltip"),r="object"==typeof e&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,r),t(this).data("bs.tooltip",n)),"string"==typeof e)){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return f}},{key:"NAME",get:function(){return i}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return d}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return u}}]),a}();t.fn[i]=m._jQueryInterface,t.fn[i].Constructor=m,t.fn[i].noConflict=function(){return t.fn[i]=a,m._jQueryInterface}}(t)}).call(e,n(0),n(3).default,n(1))},function(t,e,n){(function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){s(t,e,n[e])})}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){var n="popover",s=".bs.popover",a=t.fn[n],c=new RegExp("(^|\\s)bs-popover\\S+","g"),u=o({},e.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),l=o({},e.DefaultType,{content:"(string|element|function)"}),f={FADE:"fade",SHOW:"show"},h={TITLE:".popover-header",CONTENT:".popover-body"},d={HIDE:"hide"+s,HIDDEN:"hidden"+s,SHOW:"show"+s,SHOWN:"shown"+s,INSERTED:"inserted"+s,CLICK:"click"+s,FOCUSIN:"focusin"+s,FOCUSOUT:"focusout"+s,MOUSEENTER:"mouseenter"+s,MOUSELEAVE:"mouseleave"+s},p=function(e){function o(){return e.apply(this,arguments)||this}i(o,e);var a=o.prototype;return a.isWithContent=function(){return this.getTitle()||this._getContent()},a.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-popover-"+e)},a.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},a.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(h.TITLE),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(h.CONTENT),n),e.removeClass(f.FADE+" "+f.SHOW)},a._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},a._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(c);null!==n&&n.length>0&&e.removeClass(n.join(""))},o._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.popover"),r="object"==typeof e?e:null;if((n||!/destroy|hide/.test(e))&&(n||(n=new o(this,r),t(this).data("bs.popover",n)),"string"==typeof e)){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},r(o,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return n}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return d}},{key:"EVENT_KEY",get:function(){return s}},{key:"DefaultType",get:function(){return l}}]),o}(e);t.fn[n]=p._jQueryInterface,t.fn[n].Constructor=p,t.fn[n].noConflict=function(){return t.fn[n]=a,p._jQueryInterface}}(t)}).call(e,n(0),n(17))},function(t,e,n){(function(e,n,r){function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){o(t,e,n[e])})}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}var c=function(t){var e="tooltip",o=".bs.tooltip",s=t.fn[e],c=new RegExp("(^|\\s)bs-tooltip\\S+","g"),u={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)"},l={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},f={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},h={SHOW:"show",OUT:"out"},d={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},p={FADE:"fade",SHOW:"show"},v={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner",ARROW:".arrow"},g={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},m=function(){function s(t,e){if(void 0===n)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var m=s.prototype;return m.enable=function(){this._isEnabled=!0},m.disable=function(){this._isEnabled=!1},m.toggleEnabled=function(){this._isEnabled=!this._isEnabled},m.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,r=t(e.currentTarget).data(n);r||(r=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,r)),r._activeTrigger.click=!r._activeTrigger.click,r._isWithActiveTrigger()?r._enter(null,r):r._leave(null,r)}else{if(t(this.getTipElement()).hasClass(p.SHOW))return void this._leave(null,this);this._enter(null,this)}},m.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},m.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var i=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(i);var o=t.contains(this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!o)return;var s=this.getTipElement(),a=r.getUID(this.constructor.NAME);s.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&t(s).addClass(p.FADE);var c="function"==typeof this.config.placement?this.config.placement.call(this,s,this.element):this.config.placement,u=this._getAttachment(c);this.addAttachmentClass(u);var l=!1===this.config.container?document.body:t(this.config.container);t(s).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(s).appendTo(l),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,s,{placement:u,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:v.ARROW},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(s).addClass(p.SHOW),"ontouchstart"in document.documentElement&&t(document.body).children().on("mouseover",null,t.noop);var f=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===h.OUT&&e._leave(null,e)};if(t(this.tip).hasClass(p.FADE)){var d=r.getTransitionDurationFromElement(this.tip);t(this.tip).one(r.TRANSITION_END,f).emulateTransitionEnd(d)}else f()}},m.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE),s=function(){n._hoverState!==h.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};if(t(this.element).trigger(o),!o.isDefaultPrevented()){if(t(i).removeClass(p.SHOW),"ontouchstart"in document.documentElement&&t(document.body).children().off("mouseover",null,t.noop),this._activeTrigger[g.CLICK]=!1,this._activeTrigger[g.FOCUS]=!1,this._activeTrigger[g.HOVER]=!1,t(this.tip).hasClass(p.FADE)){var a=r.getTransitionDurationFromElement(i);t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(a)}else s();this._hoverState=""}},m.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},m.isWithContent=function(){return Boolean(this.getTitle())},m.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},m.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},m.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(v.TOOLTIP_INNER),this.getTitle()),e.removeClass(p.FADE+" "+p.SHOW)},m.setElementContent=function(e,n){var r=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?r?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[r?"html":"text"](n)},m.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},m._getAttachment=function(t){return l[t.toUpperCase()]},m._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==g.MANUAL){var r=n===g.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,i=n===g.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(r,e.config.selector,function(t){return e._enter(t)}).on(i,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=i({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},m._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},m._enter=function(e,n){var r=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(r),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(r,n)),e&&(n._activeTrigger["focusin"===e.type?g.FOCUS:g.HOVER]=!0),t(n.getTipElement()).hasClass(p.SHOW)||n._hoverState===h.SHOW?void(n._hoverState=h.SHOW):(clearTimeout(n._timeout),n._hoverState=h.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===h.SHOW&&n.show()},n.config.delay.show)):void n.show())},m._leave=function(e,n){var r=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(r),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(r,n)),e&&(n._activeTrigger["focusout"===e.type?g.FOCUS:g.HOVER]=!1),!n._isWithActiveTrigger()){if(clearTimeout(n._timeout),n._hoverState=h.OUT,!n.config.delay||!n.config.delay.hide)return void n.hide();n._timeout=setTimeout(function(){n._hoverState===h.OUT&&n.hide()},n.config.delay.hide)}},m._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},m._getConfig=function(n){return n=i({},this.constructor.Default,t(this.element).data(),"object"==typeof n&&n?n:{}),"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},m._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},m._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(c);null!==n&&n.length>0&&e.removeClass(n.join(""))},m._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},m._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p.FADE),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},s._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.tooltip"),r="object"==typeof e&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new s(this,r),t(this).data("bs.tooltip",n)),"string"==typeof e)){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},a(s,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return f}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return d}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return u}}]),s}();return t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=s,m._jQueryInterface},m}(e);t.exports=c}).call(e,n(0),n(3).default,n(1))},function(t,e,n){(function(t,e){function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}!function(t){var r="scrollspy",i=t.fn[r],s={offset:10,method:"auto",target:""},a={offset:"number",method:"string",target:"(string|element)"},c={ACTIVATE:"activate.bs.scrollspy",SCROLL:"scroll.bs.scrollspy",LOAD_DATA_API:"load.bs.scrollspy.data-api"},u={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active"},l={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},f={OFFSET:"offset",POSITION:"position"},h=function(){function i(e,n){var r=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+l.NAV_LINKS+","+this._config.target+" "+l.LIST_ITEMS+","+this._config.target+" "+l.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(c.SCROLL,function(t){return r._process(t)}),this.refresh(),this._process()}var h=i.prototype;return h.refresh=function(){var n=this,r=this._scrollElement===this._scrollElement.window?f.OFFSET:f.POSITION,i="auto"===this._config.method?r:this._config.method,o=i===f.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(n){var r,s=e.getSelectorFromElement(n);if(s&&(r=t(s)[0]),r){var a=r.getBoundingClientRect();if(a.width||a.height)return[t(r)[i]().top+o,s]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){n._offsets.push(t[0]),n._targets.push(t[1])})},h.dispose=function(){t.removeData(this._element,"bs.scrollspy"),t(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},h._getConfig=function(i){if(i=n({},s,"object"==typeof i&&i?i:{}),"string"!=typeof i.target){var o=t(i.target).attr("id");o||(o=e.getUID(r),t(i.target).attr("id",o)),i.target="#"+o}return e.typeCheckConfig(r,i,a),i},h._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},h._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},h._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},h._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var r=this._targets[this._targets.length-1];return void(this._activeTarget!==r&&this._activate(r))}if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var i=this._offsets.length;i--;)this._activeTarget!==this._targets[i]&&t>=this._offsets[i]&&(void 0===this._offsets[i+1]||t<this._offsets[i+1])&&this._activate(this._targets[i])},h._activate=function(e){this._activeTarget=e,this._clear();var n=this._selector.split(",");n=n.map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'});var r=t(n.join(","));r.hasClass(u.DROPDOWN_ITEM)?(r.closest(l.DROPDOWN).find(l.DROPDOWN_TOGGLE).addClass(u.ACTIVE),r.addClass(u.ACTIVE)):(r.addClass(u.ACTIVE),r.parents(l.NAV_LIST_GROUP).prev(l.NAV_LINKS+", "+l.LIST_ITEMS).addClass(u.ACTIVE),r.parents(l.NAV_LIST_GROUP).prev(l.NAV_ITEMS).children(l.NAV_LINKS).addClass(u.ACTIVE)),t(this._scrollElement).trigger(c.ACTIVATE,{relatedTarget:e})},h._clear=function(){t(this._selector).filter(l.ACTIVE).removeClass(u.ACTIVE)},i._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.scrollspy"),r="object"==typeof e&&e;if(n||(n=new i(this,r),t(this).data("bs.scrollspy",n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},o(i,null,[{key:"VERSION",get:function(){return"4.1.1"}},{key:"Default",get:function(){return s}}]),i}();t(window).on(c.LOAD_DATA_API,function(){for(var e=t.makeArray(t(l.DATA_SPY)),n=e.length;n--;){var r=t(e[n]);h._jQueryInterface.call(r,r.data())}}),t.fn[r]=h._jQueryInterface,t.fn[r].Constructor=h,t.fn[r].noConflict=function(){return t.fn[r]=i,h._jQueryInterface}}(t)}).call(e,n(0),n(1))},function(t,e,n){(function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}!function(t){var n=t.fn.tab,i={HIDE:"hide.bs.tab",HIDDEN:"hidden.bs.tab",SHOW:"show.bs.tab",SHOWN:"shown.bs.tab",CLICK_DATA_API:"click.bs.tab.data-api"},o={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},s={DROPDOWN:".dropdown",NAV_LIST_GROUP:".nav, .list-group",ACTIVE:".active",ACTIVE_UL:"> li > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},a=function(){function n(t){this._element=t}var a=n.prototype;return a.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(o.ACTIVE)||t(this._element).hasClass(o.DISABLED))){var r,a,c=t(this._element).closest(s.NAV_LIST_GROUP)[0],u=e.getSelectorFromElement(this._element);if(c){var l="UL"===c.nodeName?s.ACTIVE_UL:s.ACTIVE;a=t.makeArray(t(c).find(l)),a=a[a.length-1]}var f=t.Event(i.HIDE,{relatedTarget:this._element}),h=t.Event(i.SHOW,{relatedTarget:a});if(a&&t(a).trigger(f),t(this._element).trigger(h),!h.isDefaultPrevented()&&!f.isDefaultPrevented()){u&&(r=t(u)[0]),this._activate(this._element,c);var d=function(){var e=t.Event(i.HIDDEN,{relatedTarget:n._element}),r=t.Event(i.SHOWN,{relatedTarget:a});t(a).trigger(e),t(n._element).trigger(r)};r?this._activate(r,r.parentNode,d):d()}}},a.dispose=function(){t.removeData(this._element,"bs.tab"),this._element=null},a._activate=function(n,r,i){var a,c=this;a="UL"===r.nodeName?t(r).find(s.ACTIVE_UL):t(r).children(s.ACTIVE);var u=a[0],l=i&&u&&t(u).hasClass(o.FADE),f=function(){return c._transitionComplete(n,u,i)};if(u&&l){var h=e.getTransitionDurationFromElement(u);t(u).one(e.TRANSITION_END,f).emulateTransitionEnd(h)}else f()},a._transitionComplete=function(n,r,i){if(r){t(r).removeClass(o.SHOW+" "+o.ACTIVE);var a=t(r.parentNode).find(s.DROPDOWN_ACTIVE_CHILD)[0];a&&t(a).removeClass(o.ACTIVE),"tab"===r.getAttribute("role")&&r.setAttribute("aria-selected",!1)}if(t(n).addClass(o.ACTIVE),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!0),e.reflow(n),t(n).addClass(o.SHOW),n.parentNode&&t(n.parentNode).hasClass(o.DROPDOWN_MENU)){var c=t(n).closest(s.DROPDOWN)[0];c&&t(c).find(s.DROPDOWN_TOGGLE).addClass(o.ACTIVE),n.setAttribute("aria-expanded",!0)}i&&i()},n._jQueryInterface=function(e){return this.each(function(){var r=t(this),i=r.data("bs.tab");if(i||(i=new n(this),r.data("bs.tab",i)),"string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},r(n,null,[{key:"VERSION",get:function(){return"4.1.1"}}]),n}();t(document).on(i.CLICK_DATA_API,s.DATA_TOGGLE,function(e){e.preventDefault(),a._jQueryInterface.call(t(this),"show")}),t.fn.tab=a._jQueryInterface,t.fn.tab.Constructor=a,t.fn.tab.noConflict=function(){return t.fn.tab=n,a._jQueryInterface}}(t)}).call(e,n(0),n(1))},function(t,e,n){(function(t){(function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};!function(t,n){var r,i,o;i=function(){function n(n){this.element=n,this._clickEvent=e(this._clickEvent,this),this.element=t(this.element),this.nav=this.element.closest(".nav"),this.dropdown=this.element.parent().find(".dropdown-menu"),this.element.on("click",this._clickEvent),this.nav.closest(".navbar-offcanvas").on("click",function(t){return function(){if(t.dropdown.is(".shown"))return t.dropdown.removeClass("shown").closest(".open").removeClass("open")}}(this))}return n.prototype._clickEvent=function(e){return this.dropdown.hasClass("shown")||e.preventDefault(),e.stopPropagation(),t(".dropdown-toggle").not(this.element).closest(".open").removeClass("open").find(".dropdown-menu").removeClass("shown"),this.dropdown.toggleClass("shown"),this.element.parent().toggleClass("open")},n}(),o=function(){function r(n,r,i,o){this.button=n,this.element=r,this.location=i,this.offcanvas=o,this._getFade=e(this._getFade,this),this._getCss=e(this._getCss,this),this._touchEnd=e(this._touchEnd,this),this._touchMove=e(this._touchMove,this),this._touchStart=e(this._touchStart,this),this.endThreshold=130,this.startThreshold=this.element.hasClass("navbar-offcanvas-right")?t("body").outerWidth()-60:20,this.maxStartThreshold=this.element.hasClass("navbar-offcanvas-right")?t("body").outerWidth()-20:60,this.currentX=0,this.fade=!!this.element.hasClass("navbar-offcanvas-fade"),t(document).on("touchstart",this._touchStart),t(document).on("touchmove",this._touchMove),t(document).on("touchend",this._touchEnd)}return r.prototype._touchStart=function(e){if(this.startX=e.originalEvent.touches[0].pageX,this.element.is(".in"))return this.element.height(t(n).outerHeight())},r.prototype._touchMove=function(e){var n;if(t(e.target).parents(".navbar-offcanvas").length>0)return!0;if(this.startX>this.startThreshold&&this.startX<this.maxStartThreshold){if(e.preventDefault(),n=e.originalEvent.touches[0].pageX-this.startX,n=this.element.hasClass("navbar-offcanvas-right")?-n:n,Math.abs(n)<this.element.outerWidth())return this.element.css(this._getCss(n)),this.element.css(this._getFade(n))}else if(this.element.hasClass("in")&&(e.preventDefault(),n=e.originalEvent.touches[0].pageX+(this.currentX-this.startX),n=this.element.hasClass("navbar-offcanvas-right")?-n:n,Math.abs(n)<this.element.outerWidth()))return this.element.css(this._getCss(n)),this.element.css(this._getFade(n))},r.prototype._touchEnd=function(e){var n,r,i;return t(e.target).parents(".navbar-offcanvas").length>0||(r=!1,i=e.originalEvent.changedTouches[0].pageX,Math.abs(i)!==this.startX?(n=this.element.hasClass("navbar-offcanvas-right")?Math.abs(i)>this.endThreshold+50:i<this.endThreshold+50,this.element.hasClass("in")&&n?(this.currentX=0,this.element.removeClass("in").css(this._clearCss()),this.button.removeClass("is-open"),r=!0):Math.abs(i-this.startX)>this.endThreshold&&this.startX>this.startThreshold&&this.startX<this.maxStartThreshold?(this.currentX=this.element.hasClass("navbar-offcanvas-right")?-this.element.outerWidth():this.element.outerWidth(),this.element.toggleClass("in").css(this._clearCss()),this.button.toggleClass("is-open"),r=!0):this.element.css(this._clearCss()),this.offcanvas.bodyOverflow(r)):void 0)},r.prototype._getCss=function(t){return t=this.element.hasClass("navbar-offcanvas-right")?-t:t,{"-webkit-transform":"translate3d("+t+"px, 0px, 0px)","-webkit-transition-duration":"0s","-moz-transform":"translate3d("+t+"px, 0px, 0px)","-moz-transition":"0s","-o-transform":"translate3d("+t+"px, 0px, 0px)","-o-transition":"0s",transform:"translate3d("+t+"px, 0px, 0px)",transition:"0s"}},r.prototype._getFade=function(t){return this.fade?{opacity:t/this.element.outerWidth()}:{}},r.prototype._clearCss=function(){return{"-webkit-transform":"","-webkit-transition-duration":"","-moz-transform":"","-moz-transition":"","-o-transform":"","-o-transition":"",transform:"",transition:"",opacity:""}},r}(),n.Offcanvas=r=function(){function r(n){var r;this.element=n,this.bodyOverflow=e(this.bodyOverflow,this),this._sendEventsAfter=e(this._sendEventsAfter,this),this._sendEventsBefore=e(this._sendEventsBefore,this),this._documentClicked=e(this._documentClicked,this),this._close=e(this._close,this),this._open=e(this._open,this),this._clicked=e(this._clicked,this),this._navbarHeight=e(this._navbarHeight,this),r=!!this.element.attr("data-target")&&this.element.attr("data-target"),r?(this.target=t(r),this.target.length&&!this.target.hasClass("js-offcanvas-done")&&(this.element.addClass("js-offcanvas-has-events"),this.location=this.target.hasClass("navbar-offcanvas-right")?"right":"left",this.target.addClass(this._transformSupported()?"offcanvas-transform js-offcanvas-done":"offcanvas-position js-offcanvas-done"),this.target.data("offcanvas",this),this.element.on("click",this._clicked),this.target.on("transitionend",function(t){return function(){if(t.target.is(":not(.in)"))return t.target.height("")}}(this)),t(document).on("click",this._documentClicked),this.target.hasClass("navbar-offcanvas-touch")&&new o(this.element,this.target,this.location,this),this.target.find(".dropdown-toggle").each(function(){return new i(this)}),this.target.on("offcanvas.toggle",function(t){return function(e){return t._clicked(e)}}(this)),this.target.on("offcanvas.close",function(t){return function(e){return t._close(e)}}(this)),this.target.on("offcanvas.open",function(t){return function(e){return t._open(e)}}(this)))):console.warn("Offcanvas: `data-target` attribute must be present.")}return r.prototype._navbarHeight=function(){if(this.target.is(".in"))return this.target.height(t(n).outerHeight())},r.prototype._clicked=function(e){return e.preventDefault(),this._sendEventsBefore(),t(".navbar-offcanvas").not(this.target).trigger("offcanvas.close"),this.target.toggleClass("in"),this.element.toggleClass("is-open"),this._navbarHeight(),this.bodyOverflow()},r.prototype._open=function(t){if(t.preventDefault(),!this.target.is(".in"))return this._sendEventsBefore(),this.target.addClass("in"),this.element.addClass("is-open"),this._navbarHeight(),this.bodyOverflow()},r.prototype._close=function(t){if(t.preventDefault(),!this.target.is(":not(.in)"))return this._sendEventsBefore(),this.target.removeClass("in"),this.element.removeClass("is-open"),this._navbarHeight(),this.bodyOverflow()},r.prototype._documentClicked=function(e){var n;if(n=t(e.target),!n.hasClass("offcanvas-toggle")&&0===n.parents(".offcanvas-toggle").length&&0===n.parents(".navbar-offcanvas").length&&!n.hasClass("navbar-offcanvas")&&this.target.hasClass("in"))return e.preventDefault(),this._sendEventsBefore(),this.target.removeClass("in"),this.element.removeClass("is-open"),this._navbarHeight(),this.bodyOverflow()},r.prototype._sendEventsBefore=function(){return this.target.hasClass("in")?this.target.trigger("hide.bs.offcanvas"):this.target.trigger("show.bs.offcanvas")},r.prototype._sendEventsAfter=function(){return this.target.hasClass("in")?this.target.trigger("shown.bs.offcanvas"):this.target.trigger("hidden.bs.offcanvas")},r.prototype.bodyOverflow=function(e){if(null==e&&(e=!0),this.target.is(".in")?t("body").addClass("offcanvas-stop-scrolling"):t("body").removeClass("offcanvas-stop-scrolling"),e)return this._sendEventsAfter()},r.prototype._transformSupported=function(){var t,e,n,r;return e=document.createElement("div"),r="translate3d(0px, 0px, 0px)",n=/translate3d\(0px, 0px, 0px\)/g,e.style.cssText="-webkit-transform: "+r+"; -moz-transform: "+r+"; -o-transform: "+r+"; transform: "+r,t=e.style.cssText.match(n),null!=t.length},r}(),t.fn.bsOffcanvas=function(){return this.each(function(){return new r(t(this))})},t(function(){return t('[data-toggle="offcanvas"]').each(function(){return t(this).bsOffcanvas()}),t(n).on("resize",function(){return t(".navbar-offcanvas.in").each(function(){return t(this).height("").removeClass("in")}),t(".offcanvas-toggle").removeClass("is-open"),t("body").removeClass("offcanvas-stop-scrolling")}),t(".offcanvas-toggle").each(function(){return t(this).on("click",function(e){var n,r;if(!t(this).hasClass("js-offcanvas-has-events")&&(r=t(this).attr("data-target"),n=t(r)))return n.height(""),n.removeClass("in"),t("body").css({overflow:"",position:""})})})})}(t,window)}).call(this)}).call(e,n(0))},function(t,e,n){var r,i,o;!function(s){i=[n(0),n(5)],r=s,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(function(t,e){function n(n,r){var i=t(n);i.data("hammer")||i.data("hammer",new e(i[0],r))}t.fn.hammer=function(t){return this.each(function(){n(this,t)})},e.Manager.prototype.emit=function(e){return function(n,r){e.call(this,n,r),t(this.element).trigger({type:n,gesture:r})}}(e.Manager.prototype.emit)})},function(t,e,n){(function(e){var n,n;!function(e){t.exports=function(){var t;return function t(e,r,i){function o(a,c){if(!r[a]){if(!e[a]){var u="function"==typeof n&&n;if(!c&&u)return n(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[a]={exports:{}};e[a][0].call(f.exports,function(t){return o(e[a][1][t]||t)},f,f.exports,t,e,r,i)}return r[a].exports}for(var s="function"==typeof n&&n,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(t,e,n){"use strict";function r(t){return function(){var e=arguments.length;if(e){for(var n=[],r=-1;++r<e;)n[r]=arguments[r];return t.call(this,n)}return t.call(this,[])}}e.exports=r},{}],2:[function(t,e,n){(function(r){function i(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(t){}}function c(){var t;try{t=n.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG),t}n=e.exports=t(3),n.log=s,n.formatArgs=o,n.save=a,n.load=c,n.useColors=i,n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},n.enable(c())}).call(this,t(9))},{3:3,9:9}],3:[function(t,e,n){function r(t){var e,r=0;for(e in t)r=(r<<5)-r+t.charCodeAt(e),r|=0;return n.colors[Math.abs(r)%n.colors.length]}function i(t){function e(){if(e.enabled){var t=e,r=+new Date,o=r-(i||r);t.diff=o,t.prev=i,t.curr=r,i=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(e,r){if("%%"===e)return e;c++;var i=n.formatters[r];if("function"==typeof i){var o=s[c];e=i.call(t,o),s.splice(c,1),c--}return e}),n.formatArgs.call(t,s),(e.log||n.log||console.log.bind(console)).apply(t,s)}}var i;return e.namespace=t,e.enabled=n.enabled(t),e.useColors=n.useColors(),e.color=r(t),e.destroy=o,"function"==typeof n.init&&n.init(e),n.instances.push(e),e}function o(){var t=n.instances.indexOf(this);return-1!==t&&(n.instances.splice(t,1),!0)}function s(t){n.save(t),n.names=[],n.skips=[];var e,r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(e=0;e<i;e++)r[e]&&(t=r[e].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")));for(e=0;e<n.instances.length;e++){var o=n.instances[e];o.enabled=n.enabled(o.namespace)}}function a(){n.enable("")}function c(t){if("*"===t[t.length-1])return!0;var e,r;for(e=0,r=n.skips.length;e<r;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;e<r;e++)if(n.names[e].test(t))return!0;return!1}function u(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=i.debug=i.default=i,n.coerce=u,n.disable=a,n.enable=s,n.enabled=c,n.humanize=t(8),n.instances=[],n.names=[],n.skips=[],n.formatters={}},{8:8}],4:[function(t,e,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"number"==typeof t}function s(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!o(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,n,r,o,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(n=this._events[t],a(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(s(n))for(o=Array.prototype.slice.call(arguments,1),u=n.slice(),r=u.length,c=0;c<r;c++)u[c].apply(this,o);return!0},r.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?s(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,s(this._events[t])&&!this._events[t].warned&&(n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},r.prototype.removeListener=function(t,e){var n,r,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,r=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(n)){for(a=o;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],5:[function(t,n,r){(function(t){"use strict";function e(){l=!0;for(var t,e,n=f.length;n;){for(e=f,f=[],t=-1;++t<n;)e[t]();n=f.length}l=!1}function r(t){1!==f.push(t)||l||i()}var i,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var s=0,a=new o(e),c=t.document.createTextNode("");a.observe(c,{characterData:!0}),i=function(){c.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var n=t.document.createElement("script");n.onreadystatechange=function(){e(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},t.document.documentElement.appendChild(n)}:function(){setTimeout(e,0)};else{var u=new t.MessageChannel;u.port1.onmessage=e,i=function(){u.port2.postMessage(0)}}var l,f=[];n.exports=r}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],7:[function(t,e,n){"use strict";function r(){}function i(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,t!==r&&c(this,t)}function o(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function s(t,e,n){p(function(){var r;try{r=e(n)}catch(e){return v.reject(t,e)}r===t?v.reject(t,new TypeError("Cannot resolve promise with itself")):v.resolve(t,r)})}function a(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function c(t,e){function n(e){o||(o=!0,v.reject(t,e))}function r(e){o||(o=!0,v.resolve(t,e))}function i(){e(r,n)}var o=!1,s=u(i);"error"===s.status&&n(s.value)}function u(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}function l(t){return t instanceof this?t:v.resolve(new this(r),t)}function f(t){var e=new this(r);return v.reject(e,t)}function h(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,a=-1,c=new this(r);++a<n;)!function(t,r){function a(t){o[r]=t,++s!==n||i||(i=!0,v.resolve(c,o))}e.resolve(t).then(a,function(t){i||(i=!0,v.reject(c,t))})}(t[a],a);return c}function d(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(r);++o<n;)!function(t){e.resolve(t).then(function(t){i||(i=!0,v.resolve(s,t))},function(t){i||(i=!0,v.reject(s,t))})}(t[o]);return s}var p=t(5),v={},g=["REJECTED"],m=["FULFILLED"],_=["PENDING"];e.exports=i,i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){if("function"!=typeof t&&this.state===m||"function"!=typeof e&&this.state===g)return this;var n=new this.constructor(r);return this.state!==_?s(n,this.state===m?t:e,this.outcome):this.queue.push(new o(n,t,e)),n},o.prototype.callFulfilled=function(t){v.resolve(this.promise,t)},o.prototype.otherCallFulfilled=function(t){s(this.promise,this.onFulfilled,t)},o.prototype.callRejected=function(t){v.reject(this.promise,t)},o.prototype.otherCallRejected=function(t){s(this.promise,this.onRejected,t)},v.resolve=function(t,e){var n=u(a,e);if("error"===n.status)return v.reject(t,n.value);var r=n.value;if(r)c(t,r);else{t.state=m,t.outcome=e;for(var i=-1,o=t.queue.length;++i<o;)t.queue[i].callFulfilled(e)}return t},v.reject=function(t,e){t.state=g,t.outcome=e;for(var n=-1,r=t.queue.length;++n<r;)t.queue[n].callRejected(e);return t},i.resolve=l,i.reject=f,i.all=h,i.race=d},{5:5}],8:[function(t,e,n){function r(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*u;case"minutes":case"minute":case"mins":case"min":case"m":return n*c;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function i(t){return t>=l?Math.round(t/l)+"d":t>=u?Math.round(t/u)+"h":t>=c?Math.round(t/c)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function o(t){return s(t,l,"day")||s(t,u,"hour")||s(t,c,"minute")||s(t,a,"second")||t+" ms"}function s(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var a=1e3,c=60*a,u=60*c,l=24*u,f=365.25*l;e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return r(t);if("number"===n&&!1===isNaN(t))return e.long?o(t):i(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],9:[function(t,e,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function s(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function a(){g&&p&&(g=!1,p.length?v=p.concat(v):m=-1,v.length&&c())}function c(){if(!g){var t=o(a);g=!0;for(var e=v.length;e;){for(p=v,v=[];++m<e;)p&&p[m].run();m=-1,e=v.length}p=null,g=!1,s(t)}}function u(t,e){this.fun=t,this.array=e}function l(){}var f,h,d=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(t){f=r}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(t){h=i}}();var p,v=[],g=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];v.push(new u(t,e)),1!==v.length||g||o(c)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(t){return[]},d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],10:[function(e,n,r){!function(e){if("object"==typeof r)n.exports=e();else if("function"==typeof t&&t.amd)t(e);else{var i;try{i=window}catch(t){i=self}i.SparkMD5=e()}}(function(t){"use strict";function e(t,e){var n=t[0],r=t[1],i=t[2],o=t[3];n+=(r&i|~r&o)+e[0]-680876936|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+e[1]-389564586|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+e[2]+606105819|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+e[3]-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+e[4]-176418897|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+e[5]+1200080426|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+e[6]-1473231341|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+e[7]-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+e[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+e[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+e[10]-42063|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+e[11]-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+e[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+e[13]-40341101|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+e[14]-1502002290|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+e[15]+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&o|i&~o)+e[1]-165796510|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+e[6]-1069501632|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+e[11]+643717713|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+e[0]-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+e[5]-701558691|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+e[10]+38016083|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+e[15]-660478335|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+e[4]-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+e[9]+568446438|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+e[14]-1019803690|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+e[3]-187363961|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+e[8]+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+e[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+e[2]-51403784|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+e[7]+1735328473|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+e[12]-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^o)+e[5]-378558|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+e[8]-2022574463|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+e[11]+1839030562|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+e[14]-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+e[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+e[4]+1272893353|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+e[7]-155497632|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+e[10]-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+e[13]+681279174|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+e[0]-358537222|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+e[3]-722521979|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+e[6]+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+e[9]-640364487|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+e[12]-421815835|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+e[15]+530742520|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+e[2]-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~o))+e[0]-198630844|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+e[7]+1126891415|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+e[14]-1416354905|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+e[5]-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+e[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+e[3]-1894986606|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+e[10]-1051523|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+e[1]-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+e[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+e[15]-30611744|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+e[6]-1560198380|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+e[13]+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+e[4]-145523070|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+e[11]-1120210379|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+e[2]+718787259|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+e[9]-343485551|0,r=(r<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function n(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function i(t){var r,i,o,s,a,c,u=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=u;r+=64)e(l,n(t.substring(r-64,r)));for(t=t.substring(r-64),i=t.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<i;r+=1)o[r>>2]|=t.charCodeAt(r)<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(e(l,o),r=0;r<16;r+=1)o[r]=0;return s=8*u,s=s.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),c=parseInt(s[1],16)||0,o[14]=a,o[15]=c,e(l,o),l}function o(t){var n,i,o,s,a,c,u=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=u;n+=64)e(l,r(t.subarray(n-64,n)));for(t=n-64<u?t.subarray(n-64):new Uint8Array(0),i=t.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<i;n+=1)o[n>>2]|=t[n]<<(n%4<<3);if(o[n>>2]|=128<<(n%4<<3),n>55)for(e(l,o),n=0;n<16;n+=1)o[n]=0;return s=8*u,s=s.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),c=parseInt(s[1],16)||0,o[14]=a,o[15]=c,e(l,o),l}function s(t){var e,n="";for(e=0;e<4;e+=1)n+=p[t>>8*e+4&15]+p[t>>8*e&15];return n}function a(t){var e;for(e=0;e<t.length;e+=1)t[e]=s(t[e]);return t.join("")}function c(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function u(t,e){var n,r=t.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=t.charCodeAt(n);return e?o:i}function l(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function f(t,e,n){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(new Uint8Array(t)),r.set(new Uint8Array(e),t.byteLength),n?r:r.buffer}function h(t){var e,n=[],r=t.length;for(e=0;e<r-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function d(){this.reset()}var p=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return a(i("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return t=0|t||0,t<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(n,r){var i,o,s,a,c=this.byteLength,u=e(n,c),l=c;return r!==t&&(l=e(r,c)),u>l?new ArrayBuffer(0):(i=l-u,o=new ArrayBuffer(i),s=new Uint8Array(o),a=new Uint8Array(this,u,i),s.set(a),o)}}(),d.prototype.append=function(t){return this.appendBinary(c(t)),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var r,i=this._buff.length;for(r=64;r<=i;r+=64)e(this._hash,n(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},d.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=a(this._hash),t&&(n=h(n)),this.reset(),n},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},d.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(t,n){var r,i,o,s=n;if(t[s>>2]|=128<<(s%4<<3),s>55)for(e(this._hash,t),s=0;s<16;s+=1)t[s]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,e(this._hash,t)},d.hash=function(t,e){return d.hashBinary(c(t),e)},d.hashBinary=function(t,e){var n=i(t),r=a(n);return e?h(r):r},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var n,i=f(this._buff.buffer,t,!0),o=i.length;for(this._length+=t.byteLength,n=64;n<=o;n+=64)e(this._hash,r(i.subarray(n-64,n)));return this._buff=n-64<o?new Uint8Array(i.buffer.slice(n-64)):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=a(this._hash),t&&(n=h(n)),this.reset(),n},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var t=d.prototype.getState.call(this);return t.buff=l(t.buff),t},d.ArrayBuffer.prototype.setState=function(t){return t.buff=u(t.buff,!0),d.prototype.setState.call(this,t)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(t,e){var n=o(new Uint8Array(t)),r=a(n);return e?h(r):r},d})},{}],11:[function(t,e,n){var r=t(14),i=t(15),o=i;o.v1=r,o.v4=i,e.exports=o},{14:14,15:15}],12:[function(t,e,n){function r(t,e){var n=e||0,r=i;return r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]}for(var i=[],o=0;o<256;++o)i[o]=(o+256).toString(16).substr(1);e.exports=r},{}],13:[function(t,e,n){var r="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(r){var i=new Uint8Array(16);e.exports=function(){return r(i),i}}else{var o=new Array(16);e.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},{}],14:[function(t,e,n){function r(t,e,n){var r=e&&n||0,l=e||[];t=t||{};var f=t.node||i,h=void 0!==t.clockseq?t.clockseq:o;if(null==f||null==h){var d=s();null==f&&(f=i=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var p=void 0!==t.msecs?t.msecs:(new Date).getTime(),v=void 0!==t.nsecs?t.nsecs:u+1,g=p-c+(v-u)/1e4;if(g<0&&void 0===t.clockseq&&(h=h+1&16383),(g<0||p>c)&&void 0===t.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,u=v,o=h,p+=122192928e5;var m=(1e4*(268435455&p)+v)%4294967296;l[r++]=m>>>24&255,l[r++]=m>>>16&255,l[r++]=m>>>8&255,l[r++]=255&m;var _=p/4294967296*1e4&268435455;l[r++]=_>>>8&255,l[r++]=255&_,l[r++]=_>>>24&15|16,l[r++]=_>>>16&255,l[r++]=h>>>8|128,l[r++]=255&h;for(var y=0;y<6;++y)l[r+y]=f[y];return e||a(l)}var i,o,s=t(13),a=t(12),c=0,u=0;e.exports=r},{12:12,13:13}],15:[function(t,e,n){function r(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;++a)e[r+a]=s[a];return e||o(s)}var i=t(13),o=t(12);e.exports=r},{12:12,13:13}],16:[function(t,e,n){"use strict";function r(t,e,n){var r=n[n.length-1];t===r.element&&(n.pop(),r=n[n.length-1]);var i=r.element,o=r.index;if(Array.isArray(i))i.push(t);else if(o===e.length-2){var s=e.pop();i[s]=t}else e.push(t)}n.stringify=function(t){var e=[];e.push({obj:t});for(var n,r,i,o,s,a,c,u,l,f,h,d="";n=e.pop();)if(r=n.obj,i=n.prefix||"",o=n.val||"",d+=i,o)d+=o;else if("object"!=typeof r)d+=void 0===r?null:JSON.stringify(r);else if(null===r)d+="null";else if(Array.isArray(r)){for(e.push({val:"]"}),s=r.length-1;s>=0;s--)a=0===s?"":",",e.push({obj:r[s],prefix:a});e.push({val:"["})}else{c=[];for(u in r)r.hasOwnProperty(u)&&c.push(u);for(e.push({val:"}"}),s=c.length-1;s>=0;s--)l=c[s],f=r[l],h=s>0?",":"",h+=JSON.stringify(l)+":",e.push({obj:f,prefix:h});e.push({val:"{"})}return d},n.parse=function(t){for(var e,n,i,o,s,a,c,u,l,f=[],h=[],d=0;;)if("}"!==(e=t[d++])&&"]"!==e&&void 0!==e)switch(e){case" ":case"\t":case"\n":case":":case",":break;case"n":d+=3,r(null,f,h);break;case"t":d+=3,r(!0,f,h);break;case"f":d+=4,r(!1,f,h);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",d--;;){if(i=t[d++],!/[\d\.\-e\+]/.test(i)){d--;break}n+=i}r(parseFloat(n),f,h);break;case'"':for(o="",s=void 0,a=0;'"'!==(c=t[d++])||"\\"===s&&a%2==1;)o+=c,s=c,"\\"===s?a++:a=0;r(JSON.parse('"'+o+'"'),f,h);break;case"[":u={element:[],index:f.length},f.push(u.element),h.push(u);break;case"{":l={element:{},index:f.length},f.push(l.element),h.push(l);break;default:throw new Error("unexpectedly reached end of input: "+e)}else{if(1===f.length)return f.pop();r(f.pop(),f,h)}}},{}],17:[function(t,n,r){(function(e){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function i(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer||"undefined"!=typeof Blob&&t instanceof Blob}function o(t){if("function"==typeof t.slice)return t.slice(0);var e=new ArrayBuffer(t.byteLength),n=new Uint8Array(e),r=new Uint8Array(t);return n.set(r),e}function s(t){if(t instanceof ArrayBuffer)return o(t);var e=t.size,n=t.type;return"function"==typeof t.slice?t.slice(0,e,n):t.webkitSlice(0,e,n)}function a(t){var e=Object.getPrototypeOf(t);if(null===e)return!0;var n=e.constructor;return"function"==typeof n&&n instanceof n&&_i.call(n)==yi}function c(t){var e,n,r;if(!t||"object"!=typeof t)return t;if(Array.isArray(t)){for(e=[],n=0,r=t.length;n<r;n++)e[n]=c(t[n]);return e}if(t instanceof Date)return t.toISOString();if(i(t))return s(t);if(!a(t))return t;e={};for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var o=c(t[n]);void 0!==o&&(e[n]=o)}return e}function u(t){var e=!1;return ui(function(n){if(e)throw new Error("once called more than once");e=!0,t.apply(this,n)})}function l(t){return ui(function(e){e=c(e);var n=this,r="function"==typeof e[e.length-1]&&e.pop(),i=new mi(function(r,i){var o;try{var s=u(function(t,e){t?i(t):r(e)});e.push(s),(o=t.apply(n,e))&&"function"==typeof o.then&&r(o)}catch(t){i(t)}});return r&&i.then(function(t){r(null,t)},r),i})}function f(t,e,n){if(t.constructor.listeners("debug").length){for(var r=["api",t.name,e],i=0;i<n.length-1;i++)r.push(n[i]);t.constructor.emit("debug",r);var o=n[n.length-1];n[n.length-1]=function(n,r){var i=["api",t.name,e];i=i.concat(n?["error",n]:["success",r]),t.constructor.emit("debug",i),o(n,r)}}}function h(t,e){return l(ui(function(n){if(this._closed)return mi.reject(new Error("database is closed"));if(this._destroyed)return mi.reject(new Error("database is destroyed"));var r=this;return f(r,t,n),this.taskqueue.isReady?e.apply(this,n):new mi(function(e,i){r.taskqueue.addTask(function(o){o?i(o):e(r[t].apply(r,n))})})}))}function d(t){return"$"+t}function p(t){return t.substring(1)}function v(){this._store={}}function g(t){if(this._store=new v,t&&Array.isArray(t))for(var e=0,n=t.length;e<n;e++)this.add(t[e])}function m(t,e){for(var n={},r=0,i=e.length;r<i;r++){var o=e[r];o in t&&(n[o]=t[o])}return n}function _(t){return t}function y(t){return[{ok:t}]}function b(t,e,n){function r(){var t=[];h.forEach(function(e){e.docs.forEach(function(n){t.push({id:e.id,docs:[n]})})}),n(null,{results:t})}function i(){++f===l&&r()}function o(t,e,n){h[t]={id:e,docs:n},i()}function s(){if(!(p>=d.length)){var t=Math.min(p+Ti,d.length),e=d.slice(p,t);a(e,p),p+=e.length}}function a(n,r){n.forEach(function(n,i){var a=r+i,c=u.get(n),l=m(c[0],["atts_since","attachments"]);l.open_revs=c.map(function(t){return t.rev}),l.open_revs=l.open_revs.filter(_);var f=_;0===l.open_revs.length&&(delete l.open_revs,f=y),["revs","attachments","binary","ajax","latest"].forEach(function(t){t in e&&(l[t]=e[t])}),t.get(n,l,function(t,e){var r;r=t?[{error:t}]:f(e),o(a,n,r),s()})})}var c=e.docs,u=new Ei;c.forEach(function(t){u.has(t.id)?u.get(t.id).push(t):u.set(t.id,[t])});var l=u.size,f=0,h=new Array(l),d=[];u.forEach(function(t,e){d.push(e)});var p=0;s()}function E(){return"undefined"!=typeof chrome&&void 0!==chrome.storage&&void 0!==chrome.storage.local}function w(){return wi}function T(t){E()?chrome.storage.onChanged.addListener(function(e){null!=e.db_name&&t.emit(e.dbName.newValue)}):w()&&("undefined"!=typeof addEventListener?addEventListener("storage",function(e){t.emit(e.key)}):window.attachEvent("storage",function(e){t.emit(e.key)}))}function C(){fi.EventEmitter.call(this),this._listeners={},T(this)}function S(t){if("undefined"!=typeof console&&"function"==typeof console[t]){var e=Array.prototype.slice.call(arguments,1);console[t].apply(console,e)}}function O(t,e){return t=parseInt(t,10)||0,e=parseInt(e,10),e!==e||e<=t?e=(t||1)<<1:e+=1,e>6e5&&(t=3e5,e=6e5),~~((e-t)*Math.random()+t)}function A(t){var e=0;return t||(e=2e3),O(t,e)}function I(t,e){S("info","The above "+t+" is totally normal. "+e)}function D(t,e,n){Error.call(this,n),this.status=t,this.name=e,this.message=n,this.error=!0}function k(t,e){function n(e){for(var n in t)"function"!=typeof t[n]&&(this[n]=t[n]);void 0!==e&&(this.reason=e)}return n.prototype=D.prototype,new n(e)}function x(t){if("object"!=typeof t){var e=t;t=Ni,t.data=e}return"error"in t&&"conflict"===t.error&&(t.name="conflict",t.status=409),"name"in t||(t.name=t.error||"unknown"),"status"in t||(t.status=500),"message"in t||(t.message=t.message||t.reason),t}function N(t,e,n){try{return!t(e,n)}catch(t){var r="Filter function threw: "+t.toString();return k(qi,r)}}function L(t){var e={},n=t.filter&&"function"==typeof t.filter;return e.query=t.query_params,function(r){r.doc||(r.doc={});var i=n&&N(t.filter,r.doc,e);if("object"==typeof i)return i;if(i)return!1;if(t.include_docs){if(!t.attachments)for(var o in r.doc._attachments)r.doc._attachments.hasOwnProperty(o)&&(r.doc._attachments[o].stub=!0)}else delete r.doc;return!0}}function j(t){for(var e=[],n=0,r=t.length;n<r;n++)e=e.concat(t[n]);return e}function R(t){var e;if(t?"string"!=typeof t?e=k(Di):/^_/.test(t)&&!/^_(design|local)/.test(t)&&(e=k(xi)):e=k(ki),e)throw e}function q(t){return"boolean"==typeof t._remote?t._remote:"function"==typeof t.type&&(S("warn","db.type() is deprecated and will be removed in a future version of PouchDB"),"http"===t.type())}function P(t,e){return"listenerCount"in t?t.listenerCount(e):fi.EventEmitter.listenerCount(t,e)}function F(t){if(!t)return null;var e=t.split("/");return 2===e.length?e:1===e.length?[t,t]:null}function M(t){var e=F(t);return e?e.join("/"):null}function U(t){for(var e=Gi.exec(t),n={},r=14;r--;){var i=Wi[r],o=e[r]||"",s=-1!==["user","password"].indexOf(i);n[i]=s?decodeURIComponent(o):o}return n[Bi]={},n[Wi[12]].replace(Vi,function(t,e,r){e&&(n[Bi][e]=r)}),n}function H(t,e){var n=[],r=[];for(var i in e)e.hasOwnProperty(i)&&(n.push(i),r.push(e[i]));return n.push(t),Function.apply(null,n).apply(null,r)}function W(t,e,n){return new mi(function(r,i){t.get(e,function(o,s){if(o){if(404!==o.status)return i(o);s={}}var a=s._rev,c=n(s);if(!c)return r({updated:!1,rev:a});c._id=e,c._rev=a,r(B(t,c,n))})})}function B(t,e,n){return t.put(e).then(function(t){return{updated:!0,rev:t.rev}},function(r){if(409!==r.status)throw r;return W(t,e._id,n)})}function V(){return di.v4().replace(/-/g,"").toLowerCase()}function G(t){for(var e,n,r,i,o=t.rev_tree.slice();i=o.pop();){var s=i.ids,a=s[2],c=i.pos;if(a.length)for(var u=0,l=a.length;u<l;u++)o.push({pos:c+1,ids:a[u]});else{var f=!!s[1].deleted,h=s[0];e&&!(r!==f?r:n!==c?n<c:e<h)||(e=h,n=c,r=f)}}return n+"-"+e}function K(t,e){for(var n,r=t.slice();n=r.pop();)for(var i=n.pos,o=n.ids,s=o[2],a=e(0===s.length,i,o[0],n.ctx,o[1]),c=0,u=s.length;c<u;c++)r.push({pos:i+1,ids:s[c],ctx:a})}function $(t,e){return t.pos-e.pos}function X(t){var e=[];K(t,function(t,n,r,i,o){t&&e.push({rev:n+"-"+r,pos:n,opts:o})}),e.sort($).reverse();for(var n=0,r=e.length;n<r;n++)delete e[n].pos;return e}function z(t){for(var e=G(t),n=X(t.rev_tree),r=[],i=0,o=n.length;i<o;i++){var s=n[i];s.rev===e||s.opts.deleted||r.push(s.rev)}return r}function Y(t){var e=[];return K(t.rev_tree,function(t,n,r,i,o){"available"!==o.status||t||(e.push(n+"-"+r),o.status="missing")}),e}function Q(t){for(var e,n=[],r=t.slice();e=r.pop();){var i=e.pos,o=e.ids,s=o[0],a=o[1],c=o[2],u=0===c.length,l=e.history?e.history.slice():[];l.push({id:s,opts:a}),u&&n.push({pos:i+1-l.length,ids:l});for(var f=0,h=c.length;f<h;f++)r.push({pos:i+1,ids:c[f],history:l})}return n.reverse()}function J(t,e){return t.pos-e.pos}function Z(t,e,n){for(var r,i=0,o=t.length;i<o;)r=i+o>>>1,n(t[r],e)<0?i=r+1:o=r;return i}function tt(t,e,n){var r=Z(t,e,n);t.splice(r,0,e)}function et(t,e){for(var n,r,i=e,o=t.length;i<o;i++){var s=t[i],a=[s.id,s.opts,[]];r?(r[2].push(a),r=a):n=r=a}return n}function nt(t,e){return t[0]<e[0]?-1:1}function rt(t,e){for(var n=[{tree1:t,tree2:e}],r=!1;n.length>0;){var i=n.pop(),o=i.tree1,s=i.tree2;(o[1].status||s[1].status)&&(o[1].status="available"===o[1].status||"available"===s[1].status?"available":"missing");for(var a=0;a<s[2].length;a++)if(o[2][0]){for(var c=!1,u=0;u<o[2].length;u++)o[2][u][0]===s[2][a][0]&&(n.push({tree1:o[2][u],tree2:s[2][a]}),c=!0);c||(r="new_branch",tt(o[2],s[2][a],nt))}else r="new_leaf",o[2][0]=s[2][a]}return{conflicts:r,tree:t}}function it(t,e,n){var r,i=[],o=!1,s=!1;if(!t.length)return{tree:[e],conflicts:"new_leaf"};for(var a=0,c=t.length;a<c;a++){var u=t[a];if(u.pos===e.pos&&u.ids[0]===e.ids[0])r=rt(u.ids,e.ids),i.push({pos:u.pos,ids:r.tree}),o=o||r.conflicts,s=!0;else if(!0!==n){var l=u.pos<e.pos?u:e,f=u.pos<e.pos?e:u,h=f.pos-l.pos,d=[],p=[];for(p.push({ids:l.ids,diff:h,parent:null,parentIdx:null});p.length>0;){var v=p.pop();if(0!==v.diff)for(var g=v.ids[2],m=0,_=g.length;m<_;m++)p.push({ids:g[m],diff:v.diff-1,parent:v.ids,parentIdx:m});else v.ids[0]===f.ids[0]&&d.push(v)}var y=d[0];y?(r=rt(y.ids,f.ids),y.parent[2][y.parentIdx]=r.tree,i.push({pos:l.pos,ids:l.ids}),o=o||r.conflicts,s=!0):i.push(u)}else i.push(u)}return s||i.push(e),i.sort(J),{tree:i,conflicts:o||"internal_node"}}function ot(t,e){for(var n,r,i=Q(t),o=0,s=i.length;o<s;o++){var a,c=i[o],u=c.ids;if(u.length>e){n||(n={});var l=u.length-e;a={pos:c.pos+l,ids:et(u,l)};for(var f=0;f<l;f++){var h=c.pos+f+"-"+u[f].id;n[h]=!0}}else a={pos:c.pos,ids:et(u,0)};r=r?it(r,a,!0).tree:[a]}return n&&K(r,function(t,e,r){delete n[e+"-"+r]}),{tree:r,revs:n?Object.keys(n):[]}}function st(t,e,n){var r=it(t,e),i=ot(r.tree,n);return{tree:i.tree,stemmedRevs:i.revs,conflicts:r.conflicts}}function at(t,e){for(var n,r=t.slice(),i=e.split("-"),o=parseInt(i[0],10),s=i[1];n=r.pop();){if(n.pos===o&&n.ids[0]===s)return!0;for(var a=n.ids[2],c=0,u=a.length;c<u;c++)r.push({pos:n.pos+1,ids:a[c]})}return!1}function ct(t){return t.ids}function ut(t,e){e||(e=G(t));for(var n,r=e.substring(e.indexOf("-")+1),i=t.rev_tree.map(ct);n=i.pop();){if(n[0]===r)return!!n[1].deleted;i=i.concat(n[2])}}function lt(t){return/^_local/.test(t)}function ft(t,e){for(var n,r=e.rev_tree.slice();n=r.pop();){var i=n.pos,o=n.ids,s=o[0],a=o[1],c=o[2],u=0===c.length,l=n.history?n.history.slice():[];if(l.push({id:s,pos:i,opts:a}),u)for(var f=0,h=l.length;f<h;f++){var d=l[f],p=d.pos+"-"+d.id;if(p===t)return i+"-"+s}for(var v=0,g=c.length;v<g;v++)r.push({pos:i+1,ids:c[v],history:l})}throw new Error("Unable to resolve latest revision for id "+e.id+", rev "+t)}function ht(t,e,n,r){try{t.emit("change",e,n,r)}catch(t){S("error",'Error in .on("change", function):',t)}}function dt(t,e,n){function r(){i.cancel()}fi.EventEmitter.call(this);var i=this;this.db=t,e=e?c(e):{};var o=e.complete=u(function(e,n){e?P(i,"error")>0&&i.emit("error",e):i.emit("complete",n),i.removeAllListeners(),t.removeListener("destroyed",r)});n&&(i.on("complete",function(t){n(null,t)}),i.on("error",n)),t.once("destroyed",r),e.onChange=function(t,e,n){i.isCancelled||ht(i,t,e,n)};var s=new mi(function(t,n){e.complete=function(e,r){e?n(e):t(r)}});i.once("cancel",function(){t.removeListener("destroyed",r),e.complete(null,{status:"cancelled"})}),this.then=s.then.bind(s),this.catch=s.catch.bind(s),this.then(function(t){o(null,t)},o),t.taskqueue.isReady?i.validateChanges(e):t.taskqueue.addTask(function(t){t?e.complete(t):i.isCancelled?i.emit("cancel"):i.validateChanges(e)})}function pt(t,e,n){var r=[{rev:t._rev}];"all_docs"===n.style&&(r=X(e.rev_tree).map(function(t){return{rev:t.rev}}));var i={id:e.id,changes:r,doc:t};return ut(e,t._rev)&&(i.deleted=!0),n.conflicts&&(i.doc._conflicts=z(e),i.doc._conflicts.length||delete i.doc._conflicts),i}function vt(t,e){return t<e?-1:t>e?1:0}function gt(t,e){return function(n,r){n||r[0]&&r[0].error?(n=n||r[0],n.docId=e,t(n)):t(null,r.length?r[0]:r)}}function mt(t){for(var e=0;e<t.length;e++){var n=t[e];if(n._deleted)delete n._attachments;else if(n._attachments)for(var r=Object.keys(n._attachments),i=0;i<r.length;i++){var o=r[i];n._attachments[o]=m(n._attachments[o],["data","digest","content_type","length","revpos","stub"])}}}function _t(t,e){var n=vt(t._id,e._id);return 0!==n?n:vt(t._revisions?t._revisions.start:0,e._revisions?e._revisions.start:0)}function yt(t){var e={},n=[];return K(t,function(t,r,i,o){var s=r+"-"+i;return t&&(e[s]=0),void 0!==o&&n.push({from:o,to:s}),s}),n.reverse(),n.forEach(function(t){void 0===e[t.from]?e[t.from]=1+e[t.to]:e[t.from]=Math.min(e[t.from],1+e[t.to])}),e}function bt(t){var e="limit"in t?t.keys.slice(t.skip,t.limit+t.skip):t.skip>0?t.keys.slice(t.skip):t.keys;t.keys=e,t.skip=0,delete t.limit,t.descending&&(e.reverse(),t.descending=!1)}function Et(t){var e=t._compactionQueue[0],n=e.opts,r=e.callback;t.get("_local/compaction").catch(function(){return!1}).then(function(e){e&&e.last_seq&&(n.last_seq=e.last_seq),t._compact(n,function(e,n){e?r(e):r(null,n),li(function(){t._compactionQueue.shift(),t._compactionQueue.length&&Et(t)})})})}function wt(t){return"_"===t.charAt(0)&&t+" is not a valid attachment name, attachment names cannot start with '_'"}function Tt(){fi.EventEmitter.call(this)}function Ct(){this.isReady=!1,this.failed=!1,this.queue=[]}function St(t,e){var n=t.match(/([a-z-]*):\/\/(.*)/);if(n)return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=At.adapters,i=At.preferredAdapters,o=At.prefix,s=e.adapter;if(!s)for(var a=0;a<i.length&&("idb"===(s=i[a])&&"websql"in r&&w()&&localStorage["_pouch__websqldb_"+o+t]);++a)S("log",'PouchDB is downgrading "'+t+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.');var c=r[s];return{name:c&&"use_prefix"in c&&!c.use_prefix?t:o+t,adapter:s}}function Ot(t){function e(e){t.removeListener("closed",n),e||t.constructor.emit("destroyed",t.name)}function n(){t.removeListener("destroyed",e),t.constructor.emit("unref",t)}t.once("destroyed",e),t.once("closed",n),t.constructor.emit("ref",t)}function At(t,e){if(!(this instanceof At))return new At(t,e);var n=this;if(e=e||{},t&&"object"==typeof t&&(e=t,t=e.name,delete e.name),this.__opts=e=c(e),n.auto_compaction=e.auto_compaction,n.prefix=At.prefix,"string"!=typeof t)throw new Error("Missing/invalid DB name");var r=(e.prefix||"")+t,i=St(r,e);if(e.name=i.name,e.adapter=e.adapter||i.adapter,n.name=t,n._adapter=e.adapter,At.emit("debug",["adapter","Picked adapter: ",e.adapter]),!At.adapters[e.adapter]||!At.adapters[e.adapter].valid())throw new Error("Invalid Adapter: "+e.adapter);Tt.call(n),n.taskqueue=new Ct,n.adapter=e.adapter,At.adapters[e.adapter].call(n,e,function(t){if(t)return n.taskqueue.fail(t);Ot(n),n.emit("created",n),At.emit("created",n.name),n.taskqueue.ready(n)})}function It(t){t.debug=pi;var e={};t.on("debug",function(t){var n=t[0],r=t.slice(1);e[n]||(e[n]=pi("pouchdb:"+n)),e[n].apply(null,r)})}function Dt(t,e){for(var n=t,r=0,i=e.length;r<i&&(n=n[e[r]]);r++);return n}function kt(t,e){return t<e?-1:t>e?1:0}function xt(t){for(var e=[],n="",r=0,i=t.length;r<i;r++){var o=t[r];"."===o?r>0&&"\\"===t[r-1]?n=n.substring(0,n.length-1)+".":(e.push(n),n=""):n+=o}return e.push(n),e}function Nt(t){return Xi.indexOf(t)>-1}function Lt(t){return Object.keys(t)[0]}function jt(t){return t[Lt(t)]}function Rt(t){var e={};return t.forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n];if("object"!=typeof r&&(r={$eq:r}),Nt(n))r instanceof Array?e[n]=r.map(function(t){return Rt([t])}):e[n]=Rt([r]);else{var i=e[n]=e[n]||{};Object.keys(r).forEach(function(t){var e=r[t];return"$gt"===t||"$gte"===t?qt(t,e,i):"$lt"===t||"$lte"===t?Pt(t,e,i):"$ne"===t?Ft(e,i):"$eq"===t?Mt(e,i):void(i[t]=e)})}})}),e}function qt(t,e,n){void 0===n.$eq&&(void 0!==n.$gte?"$gte"===t?e>n.$gte&&(n.$gte=e):e>=n.$gte&&(delete n.$gte,n.$gt=e):void 0!==n.$gt?"$gte"===t?e>n.$gt&&(delete n.$gt,n.$gte=e):e>n.$gt&&(n.$gt=e):n[t]=e)}function Pt(t,e,n){void 0===n.$eq&&(void 0!==n.$lte?"$lte"===t?e<n.$lte&&(n.$lte=e):e<=n.$lte&&(delete n.$lte,n.$lt=e):void 0!==n.$lt?"$lte"===t?e<n.$lt&&(delete n.$lt,n.$lte=e):e<n.$lt&&(n.$lt=e):n[t]=e)}function Ft(t,e){"$ne"in e?e.$ne.push(t):e.$ne=[t]}function Mt(t,e){delete e.$gt,delete e.$gte,delete e.$lt,delete e.$lte,delete e.$ne,e.$eq=t}function Ut(t){var e=c(t),n=!1;"$and"in e&&(e=Rt(e.$and),n=!0),["$or","$nor"].forEach(function(t){t in e&&e[t].forEach(function(t){for(var e=Object.keys(t),n=0;n<e.length;n++){var r=e[n],i=t[r];"object"==typeof i&&null!==i||(t[r]={$eq:i})}})}),"$not"in e&&(e.$not=Rt([e.$not]));for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i],s=e[o];"object"!=typeof s||null===s?s={$eq:s}:"$ne"in s&&!n&&(s.$ne=[s.$ne]),e[o]=s}return e}function Ht(t,e,n){for(var r="",i=n-t.length;r.length<i;)r+=e;return r}function Wt(t,e,n){return Ht(t,e,n)+t}function Bt(t,e){if(t===e)return 0;t=Vt(t),e=Vt(e);var n=Zt(t),r=Zt(e);if(n-r!=0)return n-r;switch(typeof t){case"number":return t-e;case"boolean":return t<e?-1:1;case"string":return Qt(t,e)}return Array.isArray(t)?Yt(t,e):Jt(t,e)}function Vt(t){switch(typeof t){case"undefined":return null;case"number":return t===1/0||t===-1/0||isNaN(t)?null:t;case"object":var e=t;if(Array.isArray(t)){var n=t.length;t=new Array(n);for(var r=0;r<n;r++)t[r]=Vt(e[r])}else{if(t instanceof Date)return t.toJSON();if(null!==t){t={};for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];void 0!==o&&(t[i]=Vt(o))}}}}return t}function Gt(t){if(null!==t)switch(typeof t){case"boolean":return t?1:0;case"number":return te(t);case"string":return t.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"");case"object":var e=Array.isArray(t),n=e?t:Object.keys(t),r=-1,i=n.length,o="";if(e)for(;++r<i;)o+=Kt(n[r]);else for(;++r<i;){var s=n[r];o+=Kt(s)+Kt(t[s])}return o}return""}function Kt(t){return t=Vt(t),Zt(t)+Qi+Gt(t)+"\0"}function $t(t,e){var n,r=e;if("1"===t[e])n=0,e++;else{var i="0"===t[e];e++;var o="",s=t.substring(e,e+Yi),a=parseInt(s,10)+zi;for(i&&(a=-a),e+=Yi;;){var c=t[e];if("\0"===c)break;o+=c,e++}o=o.split("."),n=1===o.length?parseInt(o,10):parseFloat(o[0]+"."+o[1]),i&&(n-=10),0!==a&&(n=parseFloat(n+"e"+a))}return{num:n,length:e-r}}function Xt(t,e){var n=t.pop();if(e.length){var r=e[e.length-1];n===r.element&&(e.pop(),r=e[e.length-1]);var i=r.element,o=r.index;if(Array.isArray(i))i.push(n);else if(o===t.length-2){var s=t.pop();i[s]=n}else t.push(n)}}function zt(t){for(var e=[],n=[],r=0;;){var i=t[r++];if("\0"!==i)switch(i){case"1":e.push(null);break;case"2":e.push("1"===t[r]),r++;break;case"3":var o=$t(t,r);e.push(o.num),r+=o.length;break;case"4":for(var s="";;){var a=t[r];if("\0"===a)break;s+=a,r++}s=s.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,""),e.push(s);break;case"5":var c={element:[],index:e.length};e.push(c.element),n.push(c);break;case"6":var u={element:{},index:e.length};e.push(u.element),n.push(u);break;default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+i)}else{if(1===e.length)return e.pop();Xt(e,n)}}}function Yt(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=Bt(t[r],e[r]);if(0!==i)return i}return t.length===e.length?0:t.length>e.length?1:-1}function Qt(t,e){return t===e?0:t>e?1:-1}function Jt(t,e){for(var n=Object.keys(t),r=Object.keys(e),i=Math.min(n.length,r.length),o=0;o<i;o++){var s=Bt(n[o],r[o]);if(0!==s)return s;if(0!==(s=Bt(t[n[o]],e[r[o]])))return s}return n.length===r.length?0:n.length>r.length?1:-1}function Zt(t){var e=["boolean","number","string","object"],n=e.indexOf(typeof t);return~n?null===t?1:Array.isArray(t)?5:n<3?n+2:n+3:Array.isArray(t)?5:void 0}function te(t){if(0===t)return"1";var e=t.toExponential().split(/e\+?/),n=parseInt(e[1],10),r=t<0,i=r?"0":"2",o=(r?-n:n)-zi,s=Wt(o.toString(),"0",Yi);i+=Qi+s;var a=Math.abs(parseFloat(e[0]));r&&(a=10-a);var c=a.toFixed(20);return c=c.replace(/\.?0+$/,""),i+=Qi+c}function ee(t){function e(e){return t.map(function(t){var n=Lt(t),r=xt(n);return Dt(e,r)})}return function(t,n){var r=e(t.doc),i=e(n.doc),o=Bt(r,i);return 0!==o?o:kt(t.doc._id,n.doc._id)}}function ne(t,e,n){if(t=t.filter(function(t){return re(t.doc,e.selector,n)}),e.sort){var r=ee(e.sort);t=t.sort(r),"string"!=typeof e.sort[0]&&"desc"===jt(e.sort[0])&&(t=t.reverse())}if("limit"in e||"skip"in e){var i=e.skip||0,o=("limit"in e?e.limit:t.length)+i;t=t.slice(i,o)}return t}function re(t,e,n){return n.every(function(n){var r=e[n],i=xt(n),o=Dt(t,i);return Nt(n)?oe(n,r,t):ie(r,t,i,o)})}function ie(t,e,n,r){return!t||Object.keys(t).every(function(i){var o=t[i];return se(i,e,o,n,r)})}function oe(t,e,n){return"$or"===t?e.some(function(t){return re(n,t,Object.keys(t))}):"$not"===t?!re(n,e,Object.keys(e)):!e.find(function(t){return re(n,t,Object.keys(t))})}function se(t,e,n,r,i){if(!Ji[t])throw new Error('unknown operator "'+t+'" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, $nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all');return Ji[t](e,n,r,i)}function ae(t){return void 0!==t&&null!==t}function ce(t){return void 0!==t}function ue(t,e){var n=e[0],r=e[1];if(0===n)throw new Error("Bad divisor, cannot divide by zero");if(parseInt(n,10)!==n)throw new Error("Divisor is not an integer");if(parseInt(r,10)!==r)throw new Error("Modulus is not an integer");return parseInt(t,10)===t&&t%n===r}function le(t,e){return e.some(function(e){return t instanceof Array?t.indexOf(e)>-1:t===e})}function fe(t,e){return e.every(function(e){return t.indexOf(e)>-1})}function he(t,e){return t.length===e}function de(t,e){return new RegExp(e).test(t)}function pe(t,e){switch(e){case"null":return null===t;case"boolean":return"boolean"==typeof t;case"number":return"number"==typeof t;case"string":return"string"==typeof t;case"array":return t instanceof Array;case"object":return"[object Object]"==={}.toString.call(t)}throw new Error(e+" not supported as a type.Please use one of object, string, array, number, boolean or null.")}function ve(t,e){if("object"!=typeof e)throw new Error("Selector error: expected a JSON object");e=Ut(e);var n={doc:t},r=ne([n],{selector:e},Object.keys(e));return r&&1===r.length}function ge(t){return H('"use strict";\nreturn '+t+";",{})}function me(t){return H(["return function(doc) {",' "use strict";'," var emitted = false;"," var emit = function (a, b) {"," emitted = true;"," };"," var view = "+t+";"," view(doc);"," if (emitted) {"," return true;"," }","};"].join("\n"),{})}function _e(t,e){if(t.selector&&t.filter&&"_selector"!==t.filter){var n="string"==typeof t.filter?t.filter:"function";return e(new Error('selector invalid for filter "'+n+'"'))}e()}function ye(t){t.view&&!t.filter&&(t.filter="_view"),t.selector&&!t.filter&&(t.filter="_selector"),t.filter&&"string"==typeof t.filter&&("_view"===t.filter?t.view=M(t.view):t.filter=M(t.filter))}function be(t,e){return e.filter&&"string"==typeof e.filter&&!e.doc_ids&&!q(t.db)}function Ee(t,e){var n=e.complete;if("_view"===e.filter){if(!e.view||"string"!=typeof e.view){var r=k(qi,"`view` filter parameter not found or invalid.");return n(r)}var i=F(e.view);t.db.get("_design/"+i[0],function(r,o){if(t.isCancelled)return n(null,{status:"cancelled"});if(r)return n(x(r));var s=o&&o.views&&o.views[i[1]]&&o.views[i[1]].map;if(!s)return n(k(Ai,o.views?"missing json key: "+i[1]:"missing json key: views"));e.filter=me(s),t.doChanges(e)})}else if(e.selector)e.filter=function(t){return ve(t,e.selector)},t.doChanges(e);else{var o=F(e.filter);t.db.get("_design/"+o[0],function(r,i){if(t.isCancelled)return n(null,{status:"cancelled"});if(r)return n(x(r));var s=i&&i.filters&&i.filters[o[1]];if(!s)return n(k(Ai,i&&i.filters?"missing json key: "+o[1]:"missing json key: filters"));e.filter=ge(s),t.doChanges(e)})}}function we(t){t._changesFilterPlugin={validate:_e,normalize:ye,shouldFilter:be,filter:Ee}}function Te(t){return t.reduce(function(t,e){return t[e]=!0,t},{})}function Ce(t){if(!/^\d+-./.test(t))return k(Ui);var e=t.indexOf("-"),n=t.substring(0,e),r=t.substring(e+1);return{prefix:parseInt(n,10),id:r}}function Se(t,e){for(var n=t.start-t.ids.length+1,r=t.ids,i=[r[0],e,[]],o=1,s=r.length;o<s;o++)i=[r[o],{status:"missing"},[i]];return[{pos:n,ids:i}]}function Oe(t,e){var n,r,i,o={status:"available"};if(t._deleted&&(o.deleted=!0),e)if(t._id||(t._id=Ki()),r=V(),t._rev){if(i=Ce(t._rev),i.error)return i;t._rev_tree=[{pos:i.prefix,ids:[i.id,{status:"missing"},[[r,o,[]]]]}],n=i.prefix+1}else t._rev_tree=[{pos:1,ids:[r,o,[]]}],n=1;else if(t._revisions&&(t._rev_tree=Se(t._revisions,o),n=t._revisions.start,r=t._revisions.ids[0]),!t._rev_tree){if(i=Ce(t._rev),i.error)return i;n=i.prefix,r=i.id,t._rev_tree=[{pos:n,ids:[r,o,[]]}]}R(t._id),t._rev=n+"-"+r;var s={metadata:{},data:{}};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var c="_"===a[0];if(c&&!to[a]){var u=k(Ri,a);throw u.message=Ri.message+": "+a,u}c&&!eo[a]?s.metadata[a.slice(1)]=t[a]:s.data[a]=t[a]}return s}function Ae(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,r=new n,i=0;i<t.length;i+=1)r.append(t[i]);return r.getBlob(e.type)}}function Ie(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n),i=0;i<e;i++)r[i]=t.charCodeAt(i);return n}function De(t,e){return Ae([Ie(t)],{type:e})}function ke(t,e){return De(no(t),e)}function xe(t){for(var e="",n=new Uint8Array(t),r=n.byteLength,i=0;i<r;i++)e+=String.fromCharCode(n[i]);return e}function Ne(t,e){if("undefined"==typeof FileReader)return e(xe((new FileReaderSync).readAsArrayBuffer(t)));var n=new FileReader,r="function"==typeof n.readAsBinaryString;n.onloadend=function(t){var n=t.target.result||"";if(r)return e(n);e(xe(n))},r?n.readAsBinaryString(t):n.readAsArrayBuffer(t)}function Le(t,e){Ne(t,function(t){e(t)})}function je(t,e){Le(t,function(t){e(ro(t))})}function Re(t,e){if("undefined"==typeof FileReader)return e((new FileReaderSync).readAsArrayBuffer(t));var n=new FileReader;n.onloadend=function(t){var n=t.target.result||new ArrayBuffer(0);e(n)},n.readAsArrayBuffer(t)}function qe(t){return ro(t)}function Pe(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.slice(e,n)}function Fe(t,e,n,r,i){(n>0||r<e.size)&&(e=Pe(e,n,r)),Re(e,function(e){t.append(e),i()})}function Me(t,e,n,r,i){(n>0||r<e.length)&&(e=e.substring(n,r)),t.appendBinary(e),i()}function Ue(t,e){function n(){io(i)}function r(){var t=l.end(!0),n=qe(t);e(n),l.destroy()}function i(){var e=u*a,i=e+a;u++,u<c?f(l,t,e,i,n):f(l,t,e,i,r)}var o="string"==typeof t,s=o?t.length:t.size,a=Math.min(oo,s),c=Math.ceil(s/a),u=0,l=o?new vi:new vi.ArrayBuffer,f=o?Me:Fe;i()}function He(t){return vi.hash(t)}function We(t){try{return no(t)}catch(t){var e=k(Li,"Attachment is not a valid base64 string");return{error:e}}}function Be(t,e,n){var r=We(t.data);if(r.error)return n(r.error);t.length=r.length,t.data="blob"===e?De(r,t.content_type):"base64"===e?ro(r):r,Ue(r,function(e){t.digest="md5-"+e,n()})}function Ve(t,e,n){Ue(t.data,function(r){t.digest="md5-"+r,t.length=t.data.size||t.data.length||0,"binary"===e?Le(t.data,function(e){t.data=e,n()}):"base64"===e?je(t.data,function(e){t.data=e,n()}):n()})}function Ge(t,e,n){if(t.stub)return n();"string"==typeof t.data?Be(t,e,n):Ve(t,e,n)}function Ke(t,e,n){function r(){o++,t.length===o&&(i?n(i):n())}if(!t.length)return n();var i,o=0;t.forEach(function(t){function n(t){i=t,++s===o.length&&r()}var o=t.data&&t.data._attachments?Object.keys(t.data._attachments):[],s=0;if(!o.length)return r();for(var a in t.data._attachments)t.data._attachments.hasOwnProperty(a)&&Ge(t.data._attachments[a],e,n)})}function $e(t,e,n,r,i,o,s,a){if(at(e.rev_tree,n.metadata.rev))return r[i]=n,o();var c=e.winningRev||G(e),u="deleted"in e?e.deleted:ut(e,c),l="deleted"in n.metadata?n.metadata.deleted:ut(n.metadata),f=/^1-/.test(n.metadata.rev);if(u&&!l&&a&&f){var h=n.data;h._rev=c,h._id=n.metadata.id,n=Oe(h,a)}var d=st(e.rev_tree,n.metadata.rev_tree[0],t);if(a&&(u&&l&&"new_leaf"!==d.conflicts||!u&&"new_leaf"!==d.conflicts||u&&!l&&"new_branch"===d.conflicts)){var p=k(Ii);return r[i]=p,o()}var v=n.metadata.rev;n.metadata.rev_tree=d.tree,n.stemmedRevs=d.stemmedRevs||[],e.rev_map&&(n.metadata.rev_map=e.rev_map);var g,m=G(n.metadata),_=ut(n.metadata,m),y=u===_?0:u<_?-1:1;g=v===m?_:ut(n.metadata,v),s(n,m,_,g,!0,y,i,o)}function Xe(t){return"missing"===t.metadata.rev_tree[0].ids[1].status}function ze(t,e,n,r,i,o,s,a,c){function u(t,e,n){var r=G(t.metadata),i=ut(t.metadata,r);if("was_delete"in a&&i)return o[e]=k(Ai,"deleted"),n();if(f&&Xe(t)){var c=k(Ii);return o[e]=c,n()}s(t,r,i,i,!1,i?0:1,e,n)}function l(){++d===p&&c&&c()}t=t||1e3;var f=a.new_edits,h=new Ei,d=0,p=e.length;e.forEach(function(t,e){if(t._id&&lt(t._id)){var r=t._deleted?"_removeLocal":"_putLocal";return void n[r](t,{ctx:i},function(t,n){o[e]=t||n,l()})}var s=t.metadata.id;h.has(s)?(p--,h.get(s).push([t,e])):h.set(s,[[t,e]])}),h.forEach(function(e,n){function i(){++c<e.length?a():l()}function a(){var a=e[c],l=a[0],h=a[1];if(r.has(n))$e(t,r.get(n),l,o,h,i,s,f);else{var d=st([],l.metadata.rev_tree[0],t);l.metadata.rev_tree=d.tree,l.stemmedRevs=d.stemmedRevs||[],u(l,h,i)}}var c=0;a()})}function Ye(t){try{return JSON.parse(t)}catch(e){return gi.parse(t)}}function Qe(t){try{return JSON.stringify(t)}catch(e){return gi.stringify(t)}}function Je(t){return function(e){var n="unknown_error";e.target&&e.target.error&&(n=e.target.error.name||e.target.error.message),t(k(Fi,n,e.type))}}function Ze(t,e,n){return{data:Qe(t),winningRev:e,deletedOrLocal:n?"1":"0",seq:t.seq,id:t.id}}function tn(t){if(!t)return null;var e=Ye(t.data);return e.winningRev=t.winningRev,e.deleted="1"===t.deletedOrLocal,e.seq=t.seq,e}function en(t){if(!t)return t;var e=t._doc_id_rev.lastIndexOf(":");return t._id=t._doc_id_rev.substring(0,e-1),t._rev=t._doc_id_rev.substring(e+1),delete t._doc_id_rev,t}function nn(t,e,n,r){n?r(t?"string"!=typeof t?t:ke(t,e):Ae([""],{type:e})):t?"string"!=typeof t?Ne(t,function(t){r(ro(t))}):r(t):r("")}function rn(t,e,n,r){function i(){++a===s.length&&r&&r()}function o(t,e){var r=t._attachments[e],o=r.digest;n.objectStore(uo).get(o).onsuccess=function(t){r.body=t.target.result.body,i()}}var s=Object.keys(t._attachments||{});if(!s.length)return r&&r();var a=0;s.forEach(function(n){e.attachments&&e.include_docs?o(t,n):(t._attachments[n].stub=!0,i())})}function on(t,e){return mi.all(t.map(function(t){if(t.doc&&t.doc._attachments){var n=Object.keys(t.doc._attachments);return mi.all(n.map(function(n){var r=t.doc._attachments[n];if("body"in r){var i=r.body,o=r.content_type;return new mi(function(s){nn(i,o,e,function(e){t.doc._attachments[n]=Si(m(r,["digest","content_type"]),{data:e}),s()})})}}))}}))}function sn(t,e,n){function r(){--u||i()}function i(){o.length&&o.forEach(function(t){c.index("digestSeq").count(IDBKeyRange.bound(t+"::",t+"::￿",!1,!1)).onsuccess=function(e){e.target.result||a.delete(t)}})}var o=[],s=n.objectStore(co),a=n.objectStore(uo),c=n.objectStore(lo),u=t.length;t.forEach(function(t){var n=s.index("_doc_id_rev"),i=e+"::"+t;n.getKey(i).onsuccess=function(t){var e=t.target.result;if("number"!=typeof e)return r();s.delete(e),c.index("seq").openCursor(IDBKeyRange.only(e)).onsuccess=function(t){var e=t.target.result;if(e){var n=e.value.digestSeq.split("::")[0];o.push(n),c.delete(e.primaryKey),e.continue()}else r()}}})}function an(t,e,n){try{return{txn:t.transaction(e,n)}}catch(t){return{error:t}}}function cn(t,e,n,r,i,o){function s(){var t=[ao,co,uo,ho,lo,fo],e=an(i,t,"readwrite");if(e.error)return o(e.error);y=e.txn,y.onabort=Je(o),y.ontimeout=Je(o),y.oncomplete=f,b=y.objectStore(ao),E=y.objectStore(co),w=y.objectStore(uo),T=y.objectStore(lo),C=y.objectStore(fo),C.get(fo).onsuccess=function(t){O=t.target.result,u()},d(function(t){if(t)return q=!0,o(t);l()})}function a(){N=!0,u()}function c(){ze(t.revs_limit,A,r,R,y,j,p,n,a)}function u(){O&&N&&(O.docCount+=L,C.put(O))}function l(){function t(){++n===A.length&&c()}function e(e){var n=tn(e.target.result);n&&R.set(n.id,n),t()}if(A.length)for(var n=0,r=0,i=A.length;r<i;r++){var o=A[r];if(o._id&&lt(o._id))t();else{var s=b.get(o.metadata.id);s.onsuccess=e}}}function f(){q||(vo.notify(r._meta.name),o(null,j))}function h(t,e){w.get(t).onsuccess=function(n){if(n.target.result)e();else{var r=k(Hi,"unknown stub attachment with digest "+t);r.status=412,e(r)}}}function d(t){function e(){++i===n.length&&t(r)}var n=[];if(A.forEach(function(t){t.data&&t.data._attachments&&Object.keys(t.data._attachments).forEach(function(e){var r=t.data._attachments[e];r.stub&&n.push(r.digest)})}),!n.length)return t();var r,i=0;n.forEach(function(t){h(t,function(t){t&&!r&&(r=t),e()})})}function p(t,e,n,r,i,o,s,a){t.metadata.winningRev=e,t.metadata.deleted=n;var c=t.data;if(c._id=t.metadata.id,c._rev=t.metadata.rev,r&&(c._deleted=!0),c._attachments&&Object.keys(c._attachments).length)return g(t,e,n,i,s,a);L+=o,u(),v(t,e,n,i,s,a)}function v(t,e,n,i,o,s){function a(o){var s=t.stemmedRevs||[];i&&r.auto_compaction&&(s=s.concat(Y(t.metadata))),s&&s.length&&sn(s,t.metadata.id,y),f.seq=o.target.result;var a=Ze(f,e,n);b.put(a).onsuccess=u}function c(t){t.preventDefault(),t.stopPropagation(),E.index("_doc_id_rev").getKey(l._doc_id_rev).onsuccess=function(t){E.put(l,t.target.result).onsuccess=a}}function u(){j[o]={ok:!0,id:f.id,rev:f.rev},R.set(t.metadata.id,t.metadata),m(t,f.seq,s)}var l=t.data,f=t.metadata;l._doc_id_rev=f.id+"::"+f.rev,delete l._id,delete l._rev;var h=E.put(l);h.onsuccess=a,h.onerror=c}function g(t,e,n,r,i,o){function s(){u===l.length&&v(t,e,n,r,i,o)}function a(){u++,s()}var c=t.data,u=0,l=Object.keys(c._attachments);l.forEach(function(n){var r=t.data._attachments[n];if(r.stub)u++,s();else{var i=r.data;delete r.data,r.revpos=parseInt(e,10),_(r.digest,i,a)}})}function m(t,e,n){function r(){++i===o.length&&n()}var i=0,o=Object.keys(t.data._attachments||{});if(!o.length)return n();for(var s=0;s<o.length;s++)!function(n){var i=t.data._attachments[n].digest,o=T.put({seq:e,digestSeq:i+"::"+e});o.onsuccess=r,o.onerror=function(t){t.preventDefault(),t.stopPropagation(),r()}}(o[s])}function _(t,e,n){w.count(t).onsuccess=function(r){if(r.target.result)return n();var i={digest:t,body:e};w.put(i).onsuccess=n}}for(var y,b,E,w,T,C,S,O,A=e.docs,I=0,D=A.length;I<D;I++){var x=A[I];x._id&&lt(x._id)||(x=A[I]=Oe(x,n.new_edits),x.error&&!S&&(S=x))}if(S)return o(S);var N=!1,L=0,j=new Array(A.length),R=new Ei,q=!1,P=r._meta.blobSupport?"blob":"base64";Ke(A,P,function(t){if(t)return o(t);s()})}function un(t,e,n,r,i){function o(t){l=t.target.result,u&&i(u,l,f)}function s(t){u=t.target.result,l&&i(u,l,f)}function a(){if(!u.length)return i();var n,a=u[u.length-1];if(e&&e.upper)try{n=IDBKeyRange.bound(a,e.upper,!0,e.upperOpen)}catch(t){if("DataError"===t.name&&0===t.code)return i()}else n=IDBKeyRange.lowerBound(a,!0);e=n,u=null,l=null,t.getAll(e,r).onsuccess=o,t.getAllKeys(e,r).onsuccess=s}function c(t){var e=t.target.result;if(!e)return i();i([e.key],[e.value],e)}var u,l,f;"function"==typeof t.getAll&&"function"==typeof t.getAllKeys&&r>1&&!n?(f={continue:a},t.getAll(e,r).onsuccess=o,t.getAllKeys(e,r).onsuccess=s):n?t.openCursor(e,"prev").onsuccess=c:t.openCursor(e).onsuccess=c}function ln(t,e,n){function r(t){var e=t.target.result;e?(i.push(e.value),e.continue()):n({target:{result:i}})}if("function"==typeof t.getAll)return void(t.getAll(e).onsuccess=n);var i=[];t.openCursor(e).onsuccess=r}function fn(t,e,n){var r=[],i=0;t.forEach(function(o,s){e.get(o).onsuccess=function(e){e.target.result?r[s]=e.target.result:r[s]={key:o,error:"not_found"},++i===t.length&&n(t,r,{})}})}function hn(t,e,n,r,i){try{if(t&&e)return i?IDBKeyRange.bound(e,t,!n,!1):IDBKeyRange.bound(t,e,!1,!n);if(t)return i?IDBKeyRange.upperBound(t):IDBKeyRange.lowerBound(t);if(e)return i?IDBKeyRange.lowerBound(e,!n):IDBKeyRange.upperBound(e,!n);if(r)return IDBKeyRange.only(r)}catch(t){return{error:t}}return null}function dn(t,e,n){function r(e,n,r){var i=e.id+"::"+r;A.get(i).onsuccess=function(r){if(n.doc=en(r.target.result),t.conflicts){var i=z(e);i.length&&(n.doc._conflicts=i)}rn(n.doc,t,E)}}function i(e,n){var i={id:n.id,key:n.id,value:{rev:e}};n.deleted?v&&(I.push(i),i.value.deleted=!0,i.doc=null):g--<=0&&(I.push(i),t.include_docs&&r(n,i,e))}function o(t){for(var e=0,n=t.length;e<n&&I.length!==m;e++){var r=t[e];if(r.error&&v)I.push(r);else{var o=tn(r);i(o.winningRev,o)}}}function s(t,e,n){n&&(o(e),I.length<m&&n.continue())}function a(e){var n=e.target.result;t.descending&&(n=n.reverse()),o(n)}function c(){var e={total_rows:w,offset:t.skip,rows:I};t.update_seq&&void 0!==T&&(e.update_seq=T),n(null,e)}function u(){t.attachments?on(I,t.binary).then(c):c()}var l,f,h="startkey"in t&&t.startkey,d="endkey"in t&&t.endkey,p="key"in t&&t.key,v="keys"in t&&t.keys,g=t.skip||0,m="number"==typeof t.limit?t.limit:-1,_=!1!==t.inclusive_end;if(!v&&(l=hn(h,d,_,p,t.descending),(f=l&&l.error)&&("DataError"!==f.name||0!==f.code)))return n(k(Fi,f.name,f.message));var y=[ao,co,fo];t.attachments&&y.push(uo);var b=an(e,y,"readonly");if(b.error)return n(b.error);var E=b.txn;E.oncomplete=u,E.onabort=Je(n);var w,T,C=E.objectStore(ao),S=E.objectStore(co),O=E.objectStore(fo),A=S.index("_doc_id_rev"),I=[];return O.get(fo).onsuccess=function(t){w=t.target.result.docCount},t.update_seq&&function(t,e){function n(t){var n=t.target.result,r=void 0;return n&&n.key&&(r=n.key),e({target:{result:[r]}})}t.openCursor(null,"prev").onsuccess=n}(S,function(t){t.target.result&&t.target.result.length>0&&(T=t.target.result[0])}),f||0===m?void 0:v?fn(t.keys,C,s):-1===m?ln(C,l,a):void un(C,l,t.descending,m+g,s)}function pn(t){return new mi(function(e){var n=Ae([""]);t.objectStore(po).put(n,"key").onsuccess=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);e(n||!t||parseInt(t[1],10)>=43)},t.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)}}).catch(function(){return!1})}function vn(t,e){t.objectStore(ao).index("deletedOrLocal").count(IDBKeyRange.only("0")).onsuccess=function(t){e(t.target.result)}}function gn(t,e,n,r){try{t(e,n)}catch(e){r.emit("error",e)}}function mn(){!go&&mo.length&&(go=!0,mo.shift()())}function _n(t,e,n){mo.push(function(){t(function(t,r){gn(e,t,r,n),go=!1,li(function(){mn(n)})})}),mn()}function yn(t,e,n,r){function i(e,n,r){function i(e,n){var r=t.processChange(n,e,t);h=r.seq=e.seq;var i=E(r);if("object"==typeof i)return t.complete(i);i&&(b++,p&&y.push(r),t.attachments&&t.include_docs?rn(n,t,v,function(){on([r],t.binary).then(function(){t.onChange(r)})}):t.onChange(r))}function o(){for(var t=0,e=a.length;t<e&&b!==d;t++){var n=a[t];n&&i(c[t],n)}b!==d&&r.continue()}if(r&&e.length){var a=new Array(e.length),c=new Array(e.length),u=0;n.forEach(function(t,n){s(en(t),e[n],function(t,r){c[n]=t,a[n]=r,++u===e.length&&o()})})}}function o(t,e,n,r){if(n.seq!==e)return r();if(n.winningRev===t._rev)return r(n,t);var i=t._id+"::"+n.winningRev;_.get(i).onsuccess=function(t){r(n,en(t.target.result))}}function s(t,e,n){if(f&&!f.has(t._id))return n();var r=w.get(t._id);if(r)return o(t,e,r,n);m.get(t._id).onsuccess=function(i){r=tn(i.target.result),w.set(t._id,r),o(t,e,r,n)}}function a(){t.complete(null,{results:y,last_seq:h})}function u(){!t.continuous&&t.attachments?on(y).then(a):a()}if(t=c(t),t.continuous){var l=n+":"+Ki();return vo.addListener(n,l,e,t),vo.notify(n),{cancel:function(){vo.removeListener(n,l)}}}var f=t.doc_ids&&new bi(t.doc_ids);t.since=t.since||0;var h=t.since,d="limit"in t?t.limit:-1;0===d&&(d=1);var p;p="return_docs"in t?t.return_docs:!("returnDocs"in t)||t.returnDocs;var v,g,m,_,y=[],b=0,E=L(t),w=new Ei,T=[ao,co];t.attachments&&T.push(uo);var C=an(r,T,"readonly");if(C.error)return t.complete(C.error);v=C.txn,v.onabort=Je(t.complete),v.oncomplete=u,g=v.objectStore(co),m=v.objectStore(ao),_=g.index("_doc_id_rev"),un(g,t.since&&!t.descending?IDBKeyRange.lowerBound(t.since,!0):null,t.descending,d,i)}function bn(t,e){var n=this;_n(function(e){En(n,t,e)},e,n.constructor)}function En(t,e,n){function r(t){var e=t.createObjectStore(ao,{keyPath:"id"});t.createObjectStore(co,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),t.createObjectStore(uo,{keyPath:"digest"}),t.createObjectStore(fo,{keyPath:"id",autoIncrement:!1}),t.createObjectStore(po),e.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),t.createObjectStore(ho,{keyPath:"_id"});var n=t.createObjectStore(lo,{autoIncrement:!0});n.createIndex("seq","seq"),n.createIndex("digestSeq","digestSeq",{unique:!0})}function i(t,e){var n=t.objectStore(ao);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(t){var r=t.target.result;if(r){var i=r.value,o=ut(i);i.deletedOrLocal=o?"1":"0",n.put(i),r.continue()}else e()}}function o(t){t.createObjectStore(ho,{keyPath:"_id"}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0})}function s(t,e){var n=t.objectStore(ho),r=t.objectStore(ao),i=t.objectStore(co);r.openCursor().onsuccess=function(t){var o=t.target.result;if(o){var s=o.value,a=s.id,c=lt(a),u=G(s);if(c){var l=a+"::"+u,f=a+"::",h=a+"::~",d=i.index("_doc_id_rev"),p=IDBKeyRange.bound(f,h,!1,!1),v=d.openCursor(p);v.onsuccess=function(t){if(v=t.target.result){var e=v.value;e._doc_id_rev===l&&n.put(e),i.delete(v.primaryKey),v.continue()}else r.delete(o.primaryKey),o.continue()}}else o.continue()}else e&&e()}}function a(t){var e=t.createObjectStore(lo,{autoIncrement:!0});e.createIndex("seq","seq"),e.createIndex("digestSeq","digestSeq",{unique:!0})}function c(t,e){var n=t.objectStore(co),r=t.objectStore(uo),i=t.objectStore(lo);r.count().onsuccess=function(t){if(!t.target.result)return e();n.openCursor().onsuccess=function(t){var n=t.target.result;if(!n)return e();for(var r=n.value,o=n.primaryKey,s=Object.keys(r._attachments||{}),a={},c=0;c<s.length;c++)a[r._attachments[s[c]].digest]=!0;var u=Object.keys(a);for(c=0;c<u.length;c++){var l=u[c];i.put({seq:o,digestSeq:l+"::"+o})}n.continue()}}}function u(t){function e(t){return t.data?tn(t):(t.deleted="1"===t.deletedOrLocal,t)}var n=t.objectStore(co),r=t.objectStore(ao);r.openCursor().onsuccess=function(t){function i(){var t=Ze(s,s.winningRev,s.deleted);r.put(t).onsuccess=function(){o.continue()}}var o=t.target.result;if(o){var s=e(o.value);if(s.winningRev=s.winningRev||G(s),s.seq)return i();!function(){var t=s.id+"::",e=s.id+"::￿",r=n.index("_doc_id_rev").openCursor(IDBKeyRange.bound(t,e)),o=0;r.onsuccess=function(t){var e=t.target.result;if(!e)return s.seq=o,i();var n=e.primaryKey;n>o&&(o=n),e.continue()}}()}}}var f=e.name,h=null;t._meta=null,t._remote=!1,t.type=function(){return"idb"},t._id=l(function(e){e(null,t._meta.instanceId)}),t._bulkDocs=function(n,r,i){cn(e,n,r,t,h,i)},t._get=function(t,e,n){function r(){n(s,{doc:i,metadata:o,ctx:a})}var i,o,s,a=e.ctx;if(!a){var c=an(h,[ao,co,uo],"readonly");if(c.error)return n(c.error);a=c.txn}a.objectStore(ao).get(t).onsuccess=function(t){if(!(o=tn(t.target.result)))return s=k(Ai,"missing"),r();var n;if(e.rev)n=e.latest?ft(e.rev,o):e.rev;else if(n=o.winningRev,ut(o))return s=k(Ai,"deleted"),r();var c=a.objectStore(co),u=o.id+"::"+n;c.index("_doc_id_rev").get(u).onsuccess=function(t){if(i=t.target.result,i&&(i=en(i)),!i)return s=k(Ai,"missing"),r();r()}}},t._getAttachment=function(t,e,n,r,i){var o;if(r.ctx)o=r.ctx;else{var s=an(h,[ao,co,uo],"readonly");if(s.error)return i(s.error);o=s.txn}var a=n.digest,c=n.content_type;o.objectStore(uo).get(a).onsuccess=function(t){nn(t.target.result.body,c,r.binary,function(t){i(null,t)})}},t._info=function(e){var n,r,i=an(h,[fo,co],"readonly");if(i.error)return e(i.error);var o=i.txn;o.objectStore(fo).get(fo).onsuccess=function(t){r=t.target.result.docCount},o.objectStore(co).openCursor(null,"prev").onsuccess=function(t){var e=t.target.result;n=e?e.key:0},o.oncomplete=function(){e(null,{doc_count:r,update_seq:n,idb_attachment_format:t._meta.blobSupport?"binary":"base64"})}},t._allDocs=function(t,e){dn(t,h,e)},t._changes=function(e){return yn(e,t,f,h)},t._close=function(t){h.close(),_o.delete(f),t()},t._getRevisionTree=function(t,e){var n=an(h,[ao],"readonly");if(n.error)return e(n.error);n.txn.objectStore(ao).get(t).onsuccess=function(t){var n=tn(t.target.result);n?e(null,n.rev_tree):e(k(Ai))}},t._doCompaction=function(t,e,n){var r=[ao,co,uo,lo],i=an(h,r,"readwrite");if(i.error)return n(i.error);var o=i.txn;o.objectStore(ao).get(t).onsuccess=function(n){var r=tn(n.target.result);K(r.rev_tree,function(t,n,r,i,o){var s=n+"-"+r;-1!==e.indexOf(s)&&(o.status="missing")}),sn(e,t,o);var i=r.winningRev,s=r.deleted;o.objectStore(ao).put(Ze(r,i,s))},o.onabort=Je(n),o.oncomplete=function(){n()}},t._getLocal=function(t,e){var n=an(h,[ho],"readonly");if(n.error)return e(n.error);var r=n.txn,i=r.objectStore(ho).get(t);i.onerror=Je(e),i.onsuccess=function(t){var n=t.target.result;n?(delete n._doc_id_rev,e(null,n)):e(k(Ai))}},t._putLocal=function(t,e,n){"function"==typeof e&&(n=e,e={}),delete t._revisions;var r=t._rev,i=t._id;t._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var o,s=e.ctx;if(!s){var a=an(h,[ho],"readwrite");if(a.error)return n(a.error);s=a.txn,s.onerror=Je(n),s.oncomplete=function(){o&&n(null,o)}}var c,u=s.objectStore(ho);r?(c=u.get(i),c.onsuccess=function(i){var s=i.target.result;s&&s._rev===r?u.put(t).onsuccess=function(){o={ok:!0,id:t._id,rev:t._rev},e.ctx&&n(null,o)}:n(k(Ii))}):(c=u.add(t),c.onerror=function(t){n(k(Ii)),t.preventDefault(),t.stopPropagation()},c.onsuccess=function(){o={ok:!0,id:t._id,rev:t._rev},e.ctx&&n(null,o)})},t._removeLocal=function(t,e,n){"function"==typeof e&&(n=e,e={});var r=e.ctx;if(!r){var i=an(h,[ho],"readwrite");if(i.error)return n(i.error);r=i.txn,r.oncomplete=function(){o&&n(null,o)}}var o,s=t._id,a=r.objectStore(ho),c=a.get(s);c.onerror=Je(n),c.onsuccess=function(r){var i=r.target.result;i&&i._rev===t._rev?(a.delete(s),o={ok:!0,id:s,rev:"0-0"},e.ctx&&n(null,o)):n(k(Ai))}},t._destroy=function(t,e){vo.removeAllListeners(f);var n=yo.get(f);n&&n.result&&(n.result.close(),_o.delete(f));var r=indexedDB.deleteDatabase(f);r.onsuccess=function(){yo.delete(f),w()&&f in localStorage&&delete localStorage[f],e(null,{ok:!0})},r.onerror=Je(e)};var d=_o.get(f);if(d)return h=d.idb,t._meta=d.global,li(function(){n(null,t)});var p;p=e.storage?wn(f,e.storage):indexedDB.open(f,so),yo.set(f,p),p.onupgradeneeded=function(t){function e(){var t=f[h-1];h++,t&&t(l,e)}var n=t.target.result;if(t.oldVersion<1)return r(n);var l=t.currentTarget.transaction;t.oldVersion<3&&o(n),t.oldVersion<4&&a(n);var f=[i,s,c,u],h=t.oldVersion;e()},p.onsuccess=function(e){function r(){void 0!==a&&l&&(t._meta={name:f,instanceId:c,blobSupport:a},_o.set(f,{idb:h,global:t._meta}),n(null,t))}function i(){if(void 0!==s&&void 0!==o){var t=f+"_id";t in o?c=o[t]:o[t]=c=Ki(),o.docCount=s,u.objectStore(fo).put(o)}}h=e.target.result,h.onversionchange=function(){h.close(),_o.delete(f)},h.onabort=function(t){S("error","Database has a global failure",t.target.error),h.close(),_o.delete(f)};var o,s,a,c,u=h.transaction([fo,po,ao],"readwrite"),l=!1;u.objectStore(fo).get(fo).onsuccess=function(t){o=t.target.result||{id:fo},i()},vn(u,function(t){s=t,i()}),Zi||(Zi=pn(u)),Zi.then(function(t){a=t,r()}),u.oncomplete=function(){l=!0,r()},u.onabort=Je(n)},p.onerror=function(){var t="Failed to open indexedDB, are you in private browsing mode?";S("error",t),n(k(Fi,t))}}function wn(t,e){try{return indexedDB.open(t,{version:so,storage:e})}catch(e){return indexedDB.open(t,so)}}function Tn(t){t.adapter("idb",bn,!0)}function Cn(t){return decodeURIComponent(escape(t))}function Sn(t){return t<65?t-48:t-55}function On(t,e,n){for(var r="";e<n;)r+=String.fromCharCode(Sn(t.charCodeAt(e++))<<4|Sn(t.charCodeAt(e++)));return r}function An(t,e,n){for(var r="";e<n;)r+=String.fromCharCode(Sn(t.charCodeAt(e+2))<<12|Sn(t.charCodeAt(e+3))<<8|Sn(t.charCodeAt(e))<<4|Sn(t.charCodeAt(e+1))),e+=4;return r}function In(t,e){return"UTF-8"===e?Cn(On(t,0,t.length)):An(t,0,t.length)}function Dn(t){return"'"+t+"'"}function kn(t){return t.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"")}function xn(t){return t.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,"")}function Nn(t){return delete t._id,delete t._rev,JSON.stringify(t)}function Ln(t,e,n){return t=JSON.parse(t),t._id=e,t._rev=n,t}function jn(t){for(var e="(";t--;)e+="?",t&&(e+=",");return e+")"}function Rn(t,e,n,r,i){return"SELECT "+t+" FROM "+("string"==typeof e?e:e.join(" JOIN "))+(n?" ON "+n:"")+(r?" WHERE "+("string"==typeof r?r:r.join(" AND ")):"")+(i?" ORDER BY "+i:"")}function qn(t,e,n){function r(){++o===t.length&&i()}function i(){if(s.length){var t="SELECT DISTINCT digest AS digest FROM "+Oo+" WHERE seq IN "+jn(s.length);n.executeSql(t,s,function(t,e){for(var n=[],r=0;r<e.rows.length;r++)n.push(e.rows.item(r).digest);if(n.length){var i="DELETE FROM "+Oo+" WHERE seq IN ("+s.map(function(){return"?"}).join(",")+")";t.executeSql(i,s,function(t){var e="SELECT digest FROM "+Oo+" WHERE digest IN ("+n.map(function(){return"?"}).join(",")+")";t.executeSql(e,n,function(t,e){for(var r=new bi,i=0;i<e.rows.length;i++)r.add(e.rows.item(i).digest);n.forEach(function(e){r.has(e)||(t.executeSql("DELETE FROM "+Oo+" WHERE digest=?",[e]),t.executeSql("DELETE FROM "+To+" WHERE digest=?",[e]))})})})}})}}if(t.length){var o=0,s=[];t.forEach(function(t){var i="SELECT seq FROM "+wo+" WHERE doc_id=? AND rev=?";n.executeSql(i,[e,t],function(t,e){if(!e.rows.length)return r();var n=e.rows.item(0).seq;s.push(n),t.executeSql("DELETE FROM "+wo+" WHERE seq=?",[n],r)})})}}function Pn(t){return function(e){S("error","WebSQL threw an error",e);var n=e&&e.constructor.toString().match(/function ([^(]+)/),r=n&&n[1]||e.type,i=e.target||e.message;t(k(Mi,i,r))}}function Fn(t){return"size"in t?1e6*t.size:"undefined"!=typeof navigator&&/Android/.test(navigator.userAgent)?5e6:1}function Mn(t,e,n,r,i,o,s){function a(){if(y)return s(y);o.notify(r._name),s(null,b)}function c(t,e){var n="SELECT count(*) as cnt FROM "+To+" WHERE digest=?";_.executeSql(n,[t],function(n,r){if(0===r.rows.item(0).cnt){var i=k(Hi,"unknown stub attachment with digest "+t);e(i)}else e()})}function u(t){function e(){++i===n.length&&t(r)}var n=[];if(g.forEach(function(t){t.data&&t.data._attachments&&Object.keys(t.data._attachments).forEach(function(e){var r=t.data._attachments[e];r.stub&&n.push(r.digest)})}),!n.length)return t();var r,i=0;n.forEach(function(t){c(t,function(t){t&&!r&&(r=t),e()})})}function l(t,e,n,i,o,s,a,c){function u(){function e(t,e){function r(){return++i===o.length&&e(),!1}var i=0,o=Object.keys(n._attachments||{});if(!o.length)return e();for(var s=0;s<o.length;s++)!function(e){var i="INSERT INTO "+Oo+" (digest, seq) VALUES (?,?)",o=[n._attachments[e].digest,t];_.executeSql(i,o,r,r)}(o[s])}var n=t.data,r=i?1:0,o=n._id,s=n._rev,a=Nn(n),c="INSERT INTO "+wo+" (doc_id, rev, json, deleted) VALUES (?, ?, ?, ?);",u=[o,s,a,r];_.executeSql(c,u,function(t,n){var r=n.insertId;e(r,function(){h(t,r)})},function(){var t=Rn("seq",wo,null,"doc_id=? AND rev=?");return _.executeSql(t,[o,s],function(t,n){var i=n.rows.item(0).seq,c="UPDATE "+wo+" SET json=?, deleted=? WHERE doc_id=? AND rev=?;",u=[a,r,o,s];t.executeSql(c,u,function(t){e(i,function(){h(t,i)})})}),!1})}function l(t){p||(t?(p=t,c(p)):v===g.length&&u())}function f(t){v++,l(t)}function h(n,i){var s=t.metadata.id,u=t.stemmedRevs||[];o&&r.auto_compaction&&(u=Y(t.metadata).concat(u)),u.length&&qn(u,s,n),t.metadata.seq=i;var l=t.metadata.rev;delete t.metadata.rev;var f=o?"UPDATE "+Eo+" SET json=?, max_seq=?, winningseq=(SELECT seq FROM "+wo+" WHERE doc_id="+Eo+".id AND rev=?) WHERE id=?":"INSERT INTO "+Eo+" (id, winningseq, max_seq, json) VALUES (?,?,?,?);",h=Qe(t.metadata),d=o?[h,i,e,s]:[s,i,i,h];n.executeSql(f,d,function(){b[a]={ok:!0,id:t.metadata.id,rev:l},E.set(s,t.metadata),c()})}var p=null,v=0;t.data._id=t.metadata.id,t.data._rev=t.metadata.rev;var g=Object.keys(t.data._attachments||{});i&&(t.data._deleted=!0),g.forEach(function(n){var r=t.data._attachments[n];if(r.stub)v++,l();else{var i=r.data;delete r.data,r.revpos=parseInt(e,10),d(r.digest,i,f)}}),g.length||u()}function f(){ze(t.revs_limit,g,r,E,_,b,l,n)}function h(t){function e(){++n===g.length&&t()}if(!g.length)return t();var n=0;g.forEach(function(t){if(t._id&&lt(t._id))return e();var n=t.metadata.id;_.executeSql("SELECT json FROM "+Eo+" WHERE id = ?",[n],function(t,r){if(r.rows.length){var i=Ye(r.rows.item(0).json);E.set(n,i)}e()})})}function d(t,e,n){var r="SELECT digest FROM "+To+" WHERE digest=?";_.executeSql(r,[t],function(i,o){if(o.rows.length)return n();r="INSERT INTO "+To+" (digest, body, escaped) VALUES (?,?,1)",i.executeSql(r,[t,kn(e)],function(){n()},function(){return n(),!1})})}var p=n.new_edits,v=e.docs,g=v.map(function(t){return t._id&&lt(t._id)?t:Oe(t,p)}),m=g.filter(function(t){return t.error});if(m.length)return s(m[0]);var _,y,b=new Array(g.length),E=new Ei;Ke(g,"binary",function(t){if(t)return s(t);i.transaction(function(t){_=t,u(function(t){t?y=t:h(f)})},Pn(s),a)})}function Un(t){return t.websql(t.name,t.version,t.description,t.size)}function Hn(t){try{return{db:Un(t)}}catch(t){return{error:t}}}function Wn(t){var e=Ao.get(t.name);return e||(e=Hn(t),Ao.set(t.name,e)),e}function Bn(t,e,n,r,i){function o(){++c===a.length&&i&&i()}function s(t,i){var s=t._attachments[i],a={binary:e.binary,ctx:r};n._getAttachment(t._id,i,s,a,function(e,n){t._attachments[i]=Si(m(s,["digest","content_type"]),{data:n}),o()})}var a=Object.keys(t._attachments||{});if(!a.length)return i&&i();var c=0;a.forEach(function(n){e.attachments&&e.include_docs?s(t,n):(t._attachments[n].stub=!0,o())})}function Vn(t,e){function n(){w()&&(window.localStorage["_pouch__websqldb_"+y._name]=!0),e(null,y)}function r(t,e){t.executeSql(No),t.executeSql("ALTER TABLE "+wo+" ADD COLUMN deleted TINYINT(1) DEFAULT 0",[],function(){t.executeSql(ko),t.executeSql("ALTER TABLE "+Eo+" ADD COLUMN local TINYINT(1) DEFAULT 0",[],function(){t.executeSql("CREATE INDEX IF NOT EXISTS 'doc-store-local-idx' ON "+Eo+" (local, id)");var n="SELECT "+Eo+".winningseq AS seq, "+Eo+".json AS metadata FROM "+wo+" JOIN "+Eo+" ON "+wo+".seq = "+Eo+".winningseq";t.executeSql(n,[],function(t,n){for(var r=[],i=[],o=0;o<n.rows.length;o++){var s=n.rows.item(o),a=s.seq,c=JSON.parse(s.metadata);ut(c)&&r.push(a),lt(c.id)&&i.push(c.id)}t.executeSql("UPDATE "+Eo+"SET local = 1 WHERE id IN "+jn(i.length),i,function(){t.executeSql("UPDATE "+wo+" SET deleted = 1 WHERE seq IN "+jn(r.length),r,e)})})})})}function i(t,e){var n="CREATE TABLE IF NOT EXISTS "+Co+" (id UNIQUE, rev, json)";t.executeSql(n,[],function(){var n="SELECT "+Eo+".id AS id, "+wo+".json AS data FROM "+wo+" JOIN "+Eo+" ON "+wo+".seq = "+Eo+".winningseq WHERE local = 1";t.executeSql(n,[],function(t,n){function r(){if(!i.length)return e(t);var n=i.shift(),o=JSON.parse(n.data)._rev;t.executeSql("INSERT INTO "+Co+" (id, rev, json) VALUES (?,?,?)",[n.id,o,n.data],function(t){t.executeSql("DELETE FROM "+Eo+" WHERE id=?",[n.id],function(t){t.executeSql("DELETE FROM "+wo+" WHERE seq=?",[n.seq],function(){r()})})})}for(var i=[],o=0;o<n.rows.length;o++)i.push(n.rows.item(o));r()})})}function o(t,e){function n(n){function r(){if(!n.length)return e(t);var i=n.shift(),o=In(i.hex,_),s=o.lastIndexOf("::"),a=o.substring(0,s),c=o.substring(s+2),u="UPDATE "+wo+" SET doc_id=?, rev=? WHERE doc_id_rev=?";t.executeSql(u,[a,c,o],function(){r()})}r()}var r="ALTER TABLE "+wo+" ADD COLUMN doc_id";t.executeSql(r,[],function(t){var e="ALTER TABLE "+wo+" ADD COLUMN rev";t.executeSql(e,[],function(t){t.executeSql(xo,[],function(t){var e="SELECT hex(doc_id_rev) as hex FROM "+wo;t.executeSql(e,[],function(t,e){for(var r=[],i=0;i<e.rows.length;i++)r.push(e.rows.item(i));n(r)})})})})}function s(t,e){function n(t){var n="SELECT COUNT(*) AS cnt FROM "+To;t.executeSql(n,[],function(t,n){function r(){var n=Rn(qo+", "+Eo+".id AS id",[Eo,wo],Ro,null,Eo+".id ");n+=" LIMIT "+o+" OFFSET "+i,i+=o,t.executeSql(n,[],function(t,n){if(!n.rows.length)return e(t);for(var i={},o=0;o<n.rows.length;o++)for(var s=n.rows.item(o),a=Ln(s.data,s.id,s.rev),c=Object.keys(a._attachments||{}),u=0;u<c.length;u++){var l=a._attachments[c[u]];!function(t,e){var n=i[t]=i[t]||[];-1===n.indexOf(e)&&n.push(e)}(l.digest,s.seq)}var f=[];if(Object.keys(i).forEach(function(t){i[t].forEach(function(e){f.push([t,e])})}),!f.length)return r();var h=0;f.forEach(function(e){var n="INSERT INTO "+Oo+" (digest, seq) VALUES (?,?)";t.executeSql(n,e,function(){++h===f.length&&r()})})})}if(!n.rows.item(0).cnt)return e(t);var i=0,o=10;r()})}var r="CREATE TABLE IF NOT EXISTS "+Oo+" (digest, seq INTEGER)";t.executeSql(r,[],function(t){t.executeSql(jo,[],function(t){t.executeSql(Lo,[],n)})})}function a(t,e){var n="ALTER TABLE "+To+" ADD COLUMN escaped TINYINT(1) DEFAULT 0";t.executeSql(n,[],e)}function u(t,e){var n="ALTER TABLE "+Eo+" ADD COLUMN max_seq INTEGER";t.executeSql(n,[],function(t){var n="UPDATE "+Eo+" SET max_seq=(SELECT MAX(seq) FROM "+wo+" WHERE doc_id=id)";t.executeSql(n,[],function(t){var n="CREATE UNIQUE INDEX IF NOT EXISTS 'doc-max-seq-idx' ON "+Eo+" (max_seq)";t.executeSql(n,[],e)})})}function f(t,e){t.executeSql('SELECT HEX("a") AS hex',[],function(t,n){var r=n.rows.item(0).hex;_=2===r.length?"UTF-8":"UTF-16",e()})}function h(){for(;T.length>0;)T.pop()(null,b)}function d(t,e){if(0===e){var n="CREATE TABLE IF NOT EXISTS "+So+" (dbid, db_version INTEGER)",c="CREATE TABLE IF NOT EXISTS "+To+" (digest UNIQUE, escaped TINYINT(1), body BLOB)",l="CREATE TABLE IF NOT EXISTS "+Oo+" (digest, seq INTEGER)",f="CREATE TABLE IF NOT EXISTS "+Eo+" (id unique, json, winningseq, max_seq INTEGER UNIQUE)",d="CREATE TABLE IF NOT EXISTS "+wo+" (seq INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, json, deleted TINYINT(1), doc_id, rev)",p="CREATE TABLE IF NOT EXISTS "+Co+" (id UNIQUE, rev, json)";t.executeSql(c),t.executeSql(p),t.executeSql(l,[],function(){t.executeSql(Lo),t.executeSql(jo)}),t.executeSql(f,[],function(){t.executeSql(No),t.executeSql(d,[],function(){t.executeSql(ko),t.executeSql(xo),t.executeSql(n,[],function(){var e="INSERT INTO "+So+" (db_version, dbid) VALUES (?,?)";b=Ki();var n=[bo,b];t.executeSql(e,n,function(){h()})})})})}else{var v=function(){e<bo&&t.executeSql("UPDATE "+So+" SET db_version = "+bo);var n="SELECT dbid FROM "+So;t.executeSql(n,[],function(t,e){b=e.rows.item(0).dbid,h()})},g=[r,i,o,s,a,u,v],m=e,_=function(t){g[m-1](t,_),m++};_(t)}}function p(t){var e="SELECT sql FROM sqlite_master WHERE tbl_name = "+So;t.executeSql(e,[],function(t,e){e.rows.length?/db_version/.test(e.rows.item(0).sql)?t.executeSql("SELECT db_version FROM "+So,[],function(t,e){d(t,e.rows.item(0).db_version)}):t.executeSql("ALTER TABLE "+So+" ADD COLUMN db_version INTEGER",[],function(){d(t,1)}):d(t,0)})}function v(t,e){var n="SELECT MAX(seq) AS seq FROM "+wo;t.executeSql(n,[],function(t,n){var r=n.rows.item(0).seq||0;e(r)})}function g(t,e){var n=Rn("COUNT("+Eo+".id) AS 'num'",[Eo,wo],Ro,wo+".deleted=0");t.executeSql(n,[],function(t,n){e(n.rows.item(0).num)})}function m(t,e,n,r,i){var o=Rn(qo,[Eo,wo],Ro,Eo+".id=?"),s=[e];t.executeSql(o,s,function(t,e){if(!e.rows.length){var o=k(Ai,"missing");return i(o)}var s=e.rows.item(0),a=Ye(s.metadata);r(ft(n,a))})}var _,y=this,b=null,E=Fn(t),T=[];y._name=t.name;var C=Si({},t,{version:Do,description:t.name,size:E}),S=Wn(C);if(S.error)return Pn(e)(S.error);var O=S.db;"function"!=typeof O.readTransaction&&(O.readTransaction=O.transaction),function(){O.transaction(function(t){f(t,function(){p(t)})},Pn(e),n)}(),y._remote=!1,y.type=function(){return"websql"},y._id=l(function(t){t(null,b)}),y._info=function(t){var e,n;O.readTransaction(function(t){v(t,function(t){e=t}),g(t,function(t){n=t})},Pn(t),function(){t(null,{doc_count:n,update_seq:e,websql_encoding:_})})},y._bulkDocs=function(e,n,r){Mn(t,e,n,y,O,Io,r)},y._get=function(t,e,n){function r(t){n(t,{doc:i,metadata:o,ctx:s})}var i,o,s=e.ctx;if(!s)return O.readTransaction(function(r){y._get(t,Si({ctx:r},e),n)});var a,c;if(e.rev){if(e.latest)return void m(s,t,e.rev,function(r){e.latest=!1,e.rev=r,y._get(t,e,n)},r);a=Rn(qo,[Eo,wo],Eo+".id="+wo+".doc_id",[wo+".doc_id=?",wo+".rev=?"]),c=[t,e.rev]}else a=Rn(qo,[Eo,wo],Ro,Eo+".id=?"),c=[t];s.executeSql(a,c,function(t,n){if(!n.rows.length)return r(k(Ai,"missing"));var s=n.rows.item(0);if(o=Ye(s.metadata),s.deleted&&!e.rev)return r(k(Ai,"deleted"));i=Ln(s.data,o.id,s.rev),r()})},y._allDocs=function(t,e){var n,r,i=[],o="startkey"in t&&t.startkey,s="endkey"in t&&t.endkey,a="key"in t&&t.key,c="keys"in t&&t.keys,u="descending"in t&&t.descending,l="limit"in t?t.limit:-1,f="skip"in t?t.skip:0,h=!1!==t.inclusive_end,d=[],p=[];if(c){var m=[],_="";c.forEach(function(t){-1===m.indexOf(t)&&(m.push(t),_+="?,")}),_=_.substring(0,_.length-1),p.push(Eo+".id IN ("+_+")"),d=d.concat(m)}else if(!1!==a)p.push(Eo+".id = ?"),d.push(a);else if(!1!==o||!1!==s){if(!1!==o&&(p.push(Eo+".id "+(u?"<=":">=")+" ?"),d.push(o)),!1!==s){var b=u?">":"<";h&&(b+="="),p.push(Eo+".id "+b+" ?"),d.push(s)}!1!==a&&(p.push(Eo+".id = ?"),d.push(a))}c||p.push(wo+".deleted = 0"),O.readTransaction(function(e){if(g(e,function(t){n=t}),t.update_seq&&v(e,function(t){r=t}),0!==l){var o=Rn(qo,[Eo,wo],Ro,p,Eo+".id "+(u?"DESC":"ASC"));o+=" LIMIT "+l+" OFFSET "+f,e.executeSql(o,d,function(e,n){for(var r=0,o=n.rows.length;r<o;r++){var s=n.rows.item(r),a=Ye(s.metadata),u=a.id,l=Ln(s.data,u,s.rev),f=l._rev,h={id:u,key:u,value:{rev:f}};if(t.include_docs){if(h.doc=l,h.doc._rev=f,t.conflicts){var d=z(a);d.length&&(h.doc._conflicts=d)}Bn(h.doc,t,y,e)}if(s.deleted){if(!c)continue;h.value.deleted=!0,h.doc=null}if(c){var p=c.indexOf(u,p);do{i[p]=h,p=c.indexOf(u,p+1)}while(p>-1&&p<c.length)}else i.push(h)}c&&c.forEach(function(t,e){i[e]||(i[e]={key:t,error:"not_found"})})})}},Pn(e),function(){var o={total_rows:n,offset:t.skip,rows:i};t.update_seq&&(o.update_seq=r),e(null,o)})},y._changes=function(t){if(t=c(t),t.continuous){var e=y._name+":"+Ki();return Io.addListener(y._name,e,y,t),Io.notify(y._name),{cancel:function(){Io.removeListener(y._name,e)}}}var n=t.descending;t.since=t.since&&!n?t.since:0;var r="limit"in t?t.limit:-1;0===r&&(r=1);var i;i="return_docs"in t?t.return_docs:!("returnDocs"in t)||t.returnDocs;var o=[],s=0;!function(){var e=Eo+".json AS metadata, "+Eo+".max_seq AS maxSeq, "+wo+".json AS winningDoc, "+wo+".rev AS winningRev ",a=Eo+" JOIN "+wo,c=Eo+".id="+wo+".doc_id AND "+Eo+".winningseq="+wo+".seq",u=["maxSeq > ?"],l=[t.since];t.doc_ids&&(u.push(Eo+".id IN "+jn(t.doc_ids.length)),l=l.concat(t.doc_ids));var f="maxSeq "+(n?"DESC":"ASC"),h=Rn(e,a,c,u,f),d=L(t);t.view||t.filter||(h+=" LIMIT "+r);var p=t.since||0;O.readTransaction(function(e){e.executeSql(h,l,function(e,n){function a(e){return function(){t.onChange(e)}}for(var c=0,u=n.rows.length;c<u;c++){var l=n.rows.item(c),f=Ye(l.metadata);p=l.maxSeq;var h=Ln(l.winningDoc,f.id,l.winningRev),v=t.processChange(h,f,t);v.seq=l.maxSeq;var g=d(v);if("object"==typeof g)return t.complete(g);if(g&&(s++,i&&o.push(v),t.attachments&&t.include_docs?Bn(h,t,y,e,a(v)):a(v)()),s===r)break}})},Pn(t.complete),function(){t.continuous||t.complete(null,{results:o,last_seq:p})})}()},y._close=function(t){t()},y._getAttachment=function(t,e,n,r,i){var o,s=r.ctx,a=n.digest,c=n.content_type,u="SELECT escaped, CASE WHEN escaped = 1 THEN body ELSE HEX(body) END AS body FROM "+To+" WHERE digest=?";s.executeSql(u,[a],function(t,e){var n=e.rows.item(0),s=n.escaped?xn(n.body):In(n.body,_);o=r.binary?De(s,c):ro(s),i(null,o)})},y._getRevisionTree=function(t,e){O.readTransaction(function(n){var r="SELECT json AS metadata FROM "+Eo+" WHERE id = ?";n.executeSql(r,[t],function(t,n){if(n.rows.length){var r=Ye(n.rows.item(0).metadata);e(null,r.rev_tree)}else e(k(Ai))})})},y._doCompaction=function(t,e,n){if(!e.length)return n();O.transaction(function(n){var r="SELECT json AS metadata FROM "+Eo+" WHERE id = ?";n.executeSql(r,[t],function(n,r){var i=Ye(r.rows.item(0).metadata);K(i.rev_tree,function(t,n,r,i,o){var s=n+"-"+r;-1!==e.indexOf(s)&&(o.status="missing")});var o="UPDATE "+Eo+" SET json = ? WHERE id = ?";n.executeSql(o,[Qe(i),t])}),qn(e,t,n)},Pn(n),function(){n()})},y._getLocal=function(t,e){O.readTransaction(function(n){var r="SELECT json, rev FROM "+Co+" WHERE id=?";n.executeSql(r,[t],function(n,r){if(r.rows.length){var i=r.rows.item(0),o=Ln(i.json,t,i.rev);e(null,o)}else e(k(Ai))})})},y._putLocal=function(t,e,n){function r(t){var r,u;o?(r="UPDATE "+Co+" SET rev=?, json=? WHERE id=? AND rev=?",u=[i,c,s,o]):(r="INSERT INTO "+Co+" (id, rev, json) VALUES (?,?,?)",u=[s,i,c]),t.executeSql(r,u,function(t,r){r.rowsAffected?(a={ok:!0,id:s,rev:i},e.ctx&&n(null,a)):n(k(Ii))},function(){return n(k(Ii)),!1})}"function"==typeof e&&(n=e,e={}),delete t._revisions;var i,o=t._rev,s=t._id;i=t._rev=o?"0-"+(parseInt(o.split("-")[1],10)+1):"0-1";var a,c=Nn(t);e.ctx?r(e.ctx):O.transaction(r,Pn(n),function(){a&&n(null,a)})},y._removeLocal=function(t,e,n){function r(r){var o="DELETE FROM "+Co+" WHERE id=? AND rev=?",s=[t._id,t._rev];r.executeSql(o,s,function(r,o){if(!o.rowsAffected)return n(k(Ai));i={ok:!0,id:t._id,rev:"0-0"},e.ctx&&n(null,i)})}"function"==typeof e&&(n=e,e={});var i;e.ctx?r(e.ctx):O.transaction(r,Pn(n),function(){i&&n(null,i)})},y._destroy=function(t,e){Io.removeAllListeners(y._name),O.transaction(function(t){[Eo,wo,To,So,Co,Oo].forEach(function(e){t.executeSql("DROP TABLE IF EXISTS "+e,[])})},Pn(e),function(){w()&&(delete window.localStorage["_pouch__websqldb_"+y._name],delete window.localStorage[y._name]),e(null,{ok:!0})})}}function Gn(){try{return openDatabase("_pouch_validate_websql",1,"",1),!0}catch(t){return!1}}function Kn(){if("undefined"==typeof indexedDB||null===indexedDB||!/iP(hone|od|ad)/.test(navigator.userAgent))return!0;var t=w(),e="_pouch__websqldb_valid_"+navigator.userAgent;if(t&&localStorage[e])return"1"===localStorage[e];var n=Gn();return t&&(localStorage[e]=n?"1":"0"),n}function $n(){return"function"==typeof openDatabase&&Kn()}function Xn(t,e,n,r){return openDatabase(t,e,n,r)}function zn(t,e){S("warn","WebSQL is deprecated and will be removed in future releases of PouchDB. Please migrate to IndexedDB: https://pouchdb.com/2018/01/23/pouchdb-6.4.2.html");var n=Si({websql:Xn},t);Vn.call(this,n,e)}function Yn(t){t.adapter("websql",zn,!0)}function Qn(){for(var t={},e=new mi(function(e,n){t.resolve=e,t.reject=n}),n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.promise=e,mi.resolve().then(function(){return fetch.apply(null,n)}).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)}),t}function Jn(t,e){var n,r,i,o=new Headers,s={method:t.method,credentials:"include",headers:o};return t.json&&(o.set("Accept","application/json"),o.set("Content-Type",t.headers["Content-Type"]||"application/json")),t.body&&t.processData&&"string"!=typeof t.body?s.body=JSON.stringify(t.body):s.body="body"in t?t.body:null,Object.keys(t.headers).forEach(function(e){t.headers.hasOwnProperty(e)&&o.set(e,t.headers[e])}),n=Qn(t.url,s),t.timeout>0&&(r=setTimeout(function(){n.reject(new Error("Load timeout for resource: "+t.url))},t.timeout)),n.promise.then(function(e){return i={statusCode:e.status},t.timeout>0&&clearTimeout(r),i.statusCode>=200&&i.statusCode<300?t.binary?e.blob():e.text():e.json()}).then(function(t){i.statusCode>=200&&i.statusCode<300?e(null,i,t):(t.status=i.statusCode,e(t))}).catch(function(t){t||(t=new Error("canceled")),e(t)}),{abort:n.reject}}function Zn(t,e){var n,r,i=!1,o=function(){n.abort(),c()},s=function(){i=!0,n.abort(),c()},a={abort:o},c=function(){clearTimeout(r),a.abort=function(){},n&&(n.onprogress=void 0,n.upload&&(n.upload.onprogress=void 0),n.onreadystatechange=void 0,n=void 0)};n=t.xhr?new t.xhr:new XMLHttpRequest;try{n.open(t.method,t.url)}catch(t){return e(new Error(t.name||"Url is invalid"))}n.withCredentials=!("withCredentials"in t)||t.withCredentials,"GET"===t.method?delete t.headers["Content-Type"]:t.json&&(t.headers.Accept="application/json",t.headers["Content-Type"]=t.headers["Content-Type"]||"application/json",t.body&&t.processData&&"string"!=typeof t.body&&(t.body=JSON.stringify(t.body))),t.binary&&(n.responseType="arraybuffer"),"body"in t||(t.body=null);for(var u in t.headers)t.headers.hasOwnProperty(u)&&n.setRequestHeader(u,t.headers[u]);return t.timeout>0&&(r=setTimeout(s,t.timeout),n.onprogress=function(){clearTimeout(r),4!==n.readyState&&(r=setTimeout(s,t.timeout))},void 0!==n.upload&&(n.upload.onprogress=n.onprogress)),n.onreadystatechange=function(){if(4===n.readyState){var r={statusCode:n.status};if(n.status>=200&&n.status<300){var o;o=t.binary?Ae([n.response||""],{type:n.getResponseHeader("Content-Type")}):n.responseText,e(null,r,o)}else{var s={};if(i)s=new Error("ETIMEDOUT"),s.code="ETIMEDOUT";else if("string"==typeof n.response&&""!==n.response)try{s=JSON.parse(n.response)}catch(t){}s.status=n.status,e(s)}c()}},t.body&&t.body instanceof Blob?Re(t.body,function(t){n.send(t)}):n.send(t.body),a}function tr(t,e){return Po||t.xhr?Zn(t,e):Jn(t,e)}function er(){return""}function nr(t,e){function n(e,n,r){if(!t.binary&&t.json&&"string"==typeof e)try{e=JSON.parse(e)}catch(t){return r(t)}Array.isArray(e)&&(e=e.map(function(t){return t.error||t.missing?x(t):t})),t.binary,r(null,e,n)}return t=c(t),t=Si({method:"GET",headers:{},json:!0,processData:!0,timeout:1e4,cache:!1},t),t.json&&(t.binary||(t.headers.Accept="application/json"),t.headers["Content-Type"]=t.headers["Content-Type"]||"application/json"),t.binary&&(t.encoding=null,t.json=!1),t.processData||(t.json=!1),tr(t,function(r,i,o){if(r)return e(x(r));var s,a=i.headers&&i.headers["content-type"],c=o||er();if(!t.binary&&(t.json||!t.processData)&&"object"!=typeof c&&(/json/.test(a)||/^[\s]*\{/.test(c)&&/\}[\s]*$/.test(c)))try{c=JSON.parse(c.toString())}catch(t){}i.statusCode>=200&&i.statusCode<300?n(c,i,e):(s=x(c),s.status=i.statusCode,e(s))})}function rr(t,e){var n=navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",r=-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"),i=-1!==n.indexOf("msie"),o=-1!==n.indexOf("trident"),s=-1!==n.indexOf("edge"),a=r||(i||o||s)&&"GET"===t.method,c=!("cache"in t)||t.cache;if(!/^blob:/.test(t.url)&&(a||!c)){var u=-1!==t.url.indexOf("?");t.url+=(u?"&":"?")+"_nonce="+Date.now()}return nr(t,e)}function ir(t,e){return new mi(function(n,r){function i(){l++,t[f++]().then(s,a)}function o(){++h===d?u?r(u):n():c()}function s(){l--,o()}function a(t){l--,u=u||t,o()}function c(){for(;l<e&&f<d;)i()}var u,l=0,f=0,h=0,d=t.length;c()})}function or(t){var e=t.doc||t.ok,n=e._attachments;n&&Object.keys(n).forEach(function(t){var e=n[t];e.data=ke(e.data,e.content_type)})}function sr(t){return/^_design/.test(t)?"_design/"+encodeURIComponent(t.slice(8)):/^_local/.test(t)?"_local/"+encodeURIComponent(t.slice(7)):encodeURIComponent(t)}function ar(t){return t._attachments&&Object.keys(t._attachments)?mi.all(Object.keys(t._attachments).map(function(e){var n=t._attachments[e];if(n.data&&"string"!=typeof n.data)return new mi(function(t){je(n.data,t)}).then(function(t){n.data=t})})):mi.resolve()}function cr(t){if(!t.prefix)return!1;var e=U(t.prefix).protocol;return"http"===e||"https"===e}function ur(t,e){if(cr(e)){var n=e.name.substr(e.prefix.length);t=e.prefix+encodeURIComponent(n)}var r=U(t);(r.user||r.password)&&(r.auth={username:r.user,password:r.password});var i=r.path.replace(/(^\/|\/$)/g,"").split("/");return r.db=i.pop(),-1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=i.join("/"),r}function lr(t,e){return fr(t,t.db+"/"+e)}function fr(t,e){var n=t.path?"/":"";return t.protocol+"://"+t.host+(t.port?":"+t.port:"")+"/"+t.path+n+e}function hr(t){return"?"+Object.keys(t).map(function(e){return e+"="+encodeURIComponent(t[e])}).join("&")}function dr(t,e){function n(t,e,n){var r=(t||{}).ajax||{},i=Si(c(f),r,e),o=c(f.headers||{});return i.headers=Si(o,r.headers,e.headers||{}),a.constructor.listeners("debug").length&&a.constructor.emit("debug",["http",i.method,i.url]),a._ajax(i,n)}function r(t,e){return new mi(function(r,i){n(t,e,function(t,e){if(t)return i(t);r(e)})})}function i(t,e){return h(t,ui(function(t){o().then(function(){return e.apply(this,t)}).catch(function(e){t.pop()(e)})}))}function o(){return t.skipSetup||t.skip_setup?mi.resolve():g||(g=r({},{method:"GET",url:l}).catch(function(t){return t&&t.status&&404===t.status?(I(404,"PouchDB is just detecting if the remote exists."),r({},{method:"PUT",url:l})):mi.reject(t)}).catch(function(t){return!(!t||!t.status||412!==t.status)||mi.reject(t)}),g.catch(function(){g=null}),g)}function s(t){return t.split("/").map(encodeURIComponent).join("/")}var a=this,u=ur(t.name,t),l=lr(u,"");t=c(t);var f=t.ajax||{};if(t.auth||u.auth){var d=t.auth||u.auth,p=d.username+":"+d.password,v=ro(unescape(encodeURIComponent(p)));f.headers=f.headers||{},f.headers.Authorization="Basic "+v}a._ajax=rr;var g;li(function(){e(null,a)}),a._remote=!0,a.type=function(){return"http"},a.id=i("id",function(t){n({},{method:"GET",url:fr(u,"")},function(e,n){var r=n&&n.uuid?n.uuid+u.db:lr(u,"");t(null,r)})}),a.request=i("request",function(t,e){t.url=lr(u,t.url),n({},t,e)}),a.compact=i("compact",function(t,e){"function"==typeof t&&(e=t,t={}),t=c(t),n(t,{url:lr(u,"_compact"),method:"POST"},function(){function n(){a.info(function(r,i){i&&!i.compact_running?e(null,{ok:!0}):setTimeout(n,t.interval||200)})}n()})}),a.bulkGet=h("bulkGet",function(t,e){function r(e){var r={};t.revs&&(r.revs=!0),t.attachments&&(r.attachments=!0),t.latest&&(r.latest=!0),n(t,{url:lr(u,"_bulk_get"+hr(r)),method:"POST",body:{docs:t.docs}},function(n,r){!n&&t.attachments&&t.binary&&r.results.forEach(function(t){t.docs.forEach(or)}),e(n,r)})}function i(){for(var n=Mo,r=Math.ceil(t.docs.length/n),i=0,s=new Array(r),a=0;a<r;a++){var c=m(t,["revs","attachments","binary","latest"]);c.ajax=f,c.docs=t.docs.slice(a*n,Math.min(t.docs.length,(a+1)*n)),b(o,c,function(t){return function(n,o){s[t]=o.results,++i===r&&e(null,{results:j(s)})}}(a))}}var o=this,s=fr(u,""),a=Wo[s];"boolean"!=typeof a?r(function(t,n){t?(Wo[s]=!1,I(t.status,"PouchDB is just detecting if the remote supports the _bulk_get API."),i()):(Wo[s]=!0,e(null,n))}):a?r(e):i()}),a._info=function(t){o().then(function(){n({},{method:"GET",url:lr(u,"")},function(e,n){if(e)return t(e);n.host=lr(u,""),t(null,n)})}).catch(t)},a.get=i("get",function(t,e,n){function i(t){function n(n){var o=i[n],a=sr(t._id)+"/"+s(n)+"?rev="+t._rev;return r(e,{method:"GET",url:lr(u,a),binary:!0}).then(function(t){return e.binary?t:new mi(function(e){je(t,e)})}).then(function(t){delete o.stub,delete o.length,o.data=t})}var i=t._attachments,o=i&&Object.keys(i);if(i&&o.length)return ir(o.map(function(t){return function(){return n(t)}}),5)}function o(t){return Array.isArray(t)?mi.all(t.map(function(t){if(t.ok)return i(t.ok)})):i(t)}"function"==typeof e&&(n=e,e={}),e=c(e);var a={};e.revs&&(a.revs=!0),e.revs_info&&(a.revs_info=!0),e.latest&&(a.latest=!0),e.open_revs&&("all"!==e.open_revs&&(e.open_revs=JSON.stringify(e.open_revs)),a.open_revs=e.open_revs),e.rev&&(a.rev=e.rev),e.conflicts&&(a.conflicts=e.conflicts),e.update_seq&&(a.update_seq=e.update_seq),t=sr(t);var l={method:"GET",url:lr(u,t+hr(a))};r(e,l).then(function(t){return mi.resolve().then(function(){if(e.attachments)return o(t)}).then(function(){n(null,t)})}).catch(function(e){e.docId=t,n(e)})}),a.remove=i("remove",function(t,e,r,i){var o;"string"==typeof e?(o={_id:t,_rev:e},"function"==typeof r&&(i=r,r={})):(o=t,"function"==typeof e?(i=e,r={}):(i=r,r=e));var s=o._rev||r.rev;n(r,{method:"DELETE",url:lr(u,sr(o._id))+"?rev="+s},i)}),a.getAttachment=i("getAttachment",function(t,e,r,i){"function"==typeof r&&(i=r,r={});var o=r.rev?"?rev="+r.rev:"";n(r,{method:"GET",url:lr(u,sr(t))+"/"+s(e)+o,binary:!0},i)}),a.removeAttachment=i("removeAttachment",function(t,e,r,i){n({},{method:"DELETE",url:lr(u,sr(t)+"/"+s(e))+"?rev="+r},i)}),a.putAttachment=i("putAttachment",function(t,e,r,i,o,a){"function"==typeof o&&(a=o,o=i,i=r,r=null);var c=sr(t)+"/"+s(e),l=lr(u,c);if(r&&(l+="?rev="+r),"string"==typeof i){var h;try{h=no(i)}catch(t){return a(k(Li,"Attachment is not a valid base64 string"))}i=h?De(h,o):""}n({},{headers:{"Content-Type":o},method:"PUT",url:l,processData:!1,body:i,timeout:f.timeout||6e4},a)}),a._bulkDocs=function(t,e,r){t.new_edits=e.new_edits,o().then(function(){return mi.all(t.docs.map(ar))}).then(function(){n(e,{method:"POST",url:lr(u,"_bulk_docs"),timeout:e.timeout,body:t},function(t,e){if(t)return r(t);e.forEach(function(t){t.ok=!0}),r(null,e)})}).catch(r)},a._put=function(t,e,r){o().then(function(){return ar(t)}).then(function(){n(e,{method:"PUT",url:lr(u,sr(t._id)),body:t},function(e,n){if(e)return e.docId=t&&t._id,r(e);r(null,n)})}).catch(r)},a.allDocs=i("allDocs",function(t,e){"function"==typeof t&&(e=t,t={}),t=c(t);var n,i={},o="GET";t.conflicts&&(i.conflicts=!0),t.update_seq&&(i.update_seq=!0),t.descending&&(i.descending=!0),t.include_docs&&(i.include_docs=!0),t.attachments&&(i.attachments=!0),t.key&&(i.key=JSON.stringify(t.key)),t.start_key&&(t.startkey=t.start_key),t.startkey&&(i.startkey=JSON.stringify(t.startkey)),t.end_key&&(t.endkey=t.end_key),t.endkey&&(i.endkey=JSON.stringify(t.endkey)),void 0!==t.inclusive_end&&(i.inclusive_end=!!t.inclusive_end),void 0!==t.limit&&(i.limit=t.limit),void 0!==t.skip&&(i.skip=t.skip);var s=hr(i);void 0!==t.keys&&(o="POST",n={keys:t.keys}),r(t,{method:o,url:lr(u,"_all_docs"+s),body:n}).then(function(n){t.include_docs&&t.attachments&&t.binary&&n.rows.forEach(or),e(null,n)}).catch(e)}),a._changes=function(t){var e="batch_size"in t?t.batch_size:Fo;t=c(t),!t.continuous||"heartbeat"in t||(t.heartbeat=Ho);var r="timeout"in t?t.timeout:"timeout"in f?f.timeout:3e4;"timeout"in t&&t.timeout&&r-t.timeout<Uo&&(r=t.timeout+Uo),"heartbeat"in t&&t.heartbeat&&r-t.heartbeat<Uo&&(r=t.heartbeat+Uo);var i={};"timeout"in t&&t.timeout&&(i.timeout=t.timeout);var s,a=void 0!==t.limit&&t.limit;s="return_docs"in t?t.return_docs:!("returnDocs"in t)||t.returnDocs;var l=a;if(t.style&&(i.style=t.style),(t.include_docs||t.filter&&"function"==typeof t.filter)&&(i.include_docs=!0),t.attachments&&(i.attachments=!0),t.continuous&&(i.feed="longpoll"),t.seq_interval&&(i.seq_interval=t.seq_interval),t.conflicts&&(i.conflicts=!0),t.descending&&(i.descending=!0),t.update_seq&&(i.update_seq=!0),"heartbeat"in t&&t.heartbeat&&(i.heartbeat=t.heartbeat),t.filter&&"string"==typeof t.filter&&(i.filter=t.filter),t.view&&"string"==typeof t.view&&(i.filter="_view",i.view=t.view),t.query_params&&"object"==typeof t.query_params)for(var h in t.query_params)t.query_params.hasOwnProperty(h)&&(i[h]=t.query_params[h]);var d,p="GET";t.doc_ids?(i.filter="_doc_ids",p="POST",d={doc_ids:t.doc_ids}):t.selector&&(i.filter="_selector",p="POST",d={selector:t.selector});var v,g,m=function(s,c){if(!t.aborted){i.since=s,"object"==typeof i.since&&(i.since=JSON.stringify(i.since)),t.descending?a&&(i.limit=l):i.limit=!a||l>e?e:l;var f={method:p,url:lr(u,"_changes"+hr(i)),timeout:r,body:d};g=s,t.aborted||o().then(function(){v=n(t,f,c)}).catch(c)}},_={results:[]},y=function(n,r){if(!t.aborted){var i=0;if(r&&r.results){i=r.results.length,_.last_seq=r.last_seq;var o=null,c=null;"number"==typeof r.pending&&(o=r.pending),"string"!=typeof _.last_seq&&"number"!=typeof _.last_seq||(c=_.last_seq),{}.query=t.query_params,r.results=r.results.filter(function(e){l--;var n=L(t)(e);return n&&(t.include_docs&&t.attachments&&t.binary&&or(e),s&&_.results.push(e),t.onChange(e,o,c)),n})}else if(n)return t.aborted=!0,void t.complete(n);r&&r.last_seq&&(g=r.last_seq);var u=a&&l<=0||r&&i<e||t.descending;(!t.continuous||a&&l<=0)&&u?t.complete(null,_):li(function(){m(g,y)})}};return m(t.since||0,y),{cancel:function(){t.aborted=!0,v&&v.abort()}}},a.revsDiff=i("revsDiff",function(t,e,r){"function"==typeof e&&(r=e,e={}),n(e,{method:"POST",url:lr(u,"_revs_diff"),body:t},r)}),a._close=function(t){t()},a._destroy=function(t,e){n(t,{url:lr(u,""),method:"DELETE"},function(t,n){if(t&&t.status&&404!==t.status)return e(t);e(null,n)})}}function pr(t){t.adapter("http",dr,!1),t.adapter("https",dr,!1)}function vr(t){this.status=400,this.name="query_parse_error",this.message=t,this.error=!0;try{Error.captureStackTrace(this,vr)}catch(t){}}function gr(t){this.status=404,this.name="not_found",this.message=t,this.error=!0;try{Error.captureStackTrace(this,gr)}catch(t){}}function mr(t){this.status=500,this.name="invalid_value",this.message=t,this.error=!0;try{Error.captureStackTrace(this,mr)}catch(t){}}function _r(t,e){return e&&t.then(function(t){li(function(){e(null,t)})},function(t){li(function(){e(t)})}),t}function yr(t){return ui(function(e){var n=e.pop(),r=t.apply(this,e);return"function"==typeof n&&_r(r,n),r})}function br(t,e){return t.then(function(t){return e().then(function(){return t})},function(t){return e().then(function(){throw t})})}function Er(t,e){return function(){var n=arguments,r=this;return t.add(function(){return e.apply(r,n)})}}function wr(t){var e=new bi(t),n=new Array(e.size),r=-1;return e.forEach(function(t){n[++r]=t}),n}function Tr(t){var e=new Array(t.size),n=-1;return t.forEach(function(t,r){e[++n]=r}),e}function Cr(t){return new mr("builtin "+t+" function requires map values to be numbers or number arrays")}function Sr(t){for(var e=0,n=0,r=t.length;n<r;n++){var i=t[n];if("number"!=typeof i){if(!Array.isArray(i))throw Cr("_sum");e="number"==typeof e?[e]:e;for(var o=0,s=i.length;o<s;o++){var a=i[o];if("number"!=typeof a)throw Cr("_sum");void 0===e[o]?e.push(a):e[o]+=a}}else"number"==typeof e?e+=i:e[0]+=i}return e}function Or(t,e){return H("return ("+t.replace(/;\s*$/,"")+");",{emit:e,sum:Sr,log:Bo,isArray:Vo,toJSON:Go})}function Ar(){this.promise=new mi(function(t){t()})}function Ir(t){if(!t)return"undefined";switch(typeof t){case"function":case"string":return t.toString();default:return JSON.stringify(t)}}function Dr(t,e){return Ir(t)+Ir(e)+"undefined"}function kr(t,e,n,r,i,o){var s,a=Dr(n,r);if(!i&&(s=t._cachedViews=t._cachedViews||{},s[a]))return s[a];var c=t.info().then(function(c){function u(t){t.views=t.views||{};var n=e;-1===n.indexOf("/")&&(n=e+"/"+e);var r=t.views[n]=t.views[n]||{};if(!r[l])return r[l]=!0,t}var l=c.db_name+"-mrview-"+(i?"temp":He(a));return W(t,"_local/"+o,u).then(function(){return t.registerDependentDatabase(l).then(function(e){var i=e.db;i.auto_compaction=!0;var o={name:l,db:i,sourceDB:t,adapter:t.adapter,mapFun:n,reduceFun:r};return o.db.get("_local/lastSeq").catch(function(t){if(404!==t.status)throw t}).then(function(t){return o.seq=t?t.seq:0,s&&o.db.once("destroyed",function(){delete s[a]}),o})})})});return s&&(s[a]=c),c}function xr(t){return-1===t.indexOf("/")?[t,t]:t.split("/")}function Nr(t){return 1===t.length&&/^1-/.test(t[0].rev)}function Lr(t,e){try{t.emit("error",e)}catch(t){S("error","The user's map/reduce function threw an uncaught error.\nYou can debug this error by doing:\nmyDatabase.on('error', function (err) { debugger; });\nPlease double-check your map/reduce function."),S("error",e)}}function jr(t){if(/^_sum/.test(t))return zo._sum;if(/^_count/.test(t))return zo._count;if(/^_stats/.test(t))return zo._stats;if(/^_/.test(t))throw new Error(t+" is not a supported reduce function.")}function Rr(t,e){if("function"==typeof t&&2===t.length){var n=t;return function(t){return n(t,e)}}return Or(t.toString(),e)}function qr(t){var e=t.toString();return jr(e)||Or(e)}function Pr(t,e){var n=t.views&&t.views[e];if("string"!=typeof n.map)throw new gr("ddoc "+t._id+" has no string view named "+e+", instead found object of type: "+typeof n.map)}function Fr(t,e,n){return Yo.query.call(this,t,e,n)}function Mr(t){return Yo.viewCleanup.call(this,t)}function Ur(t){return/^1-/.test(t)}function Hr(t,e,n){return!t._attachments||!t._attachments[n]||t._attachments[n].digest!==e._attachments[n].digest}function Wr(t,e){var n=Object.keys(e._attachments);return mi.all(n.map(function(n){return t.getAttachment(e._id,n,{rev:e._rev})}))}function Br(t,e,n){var r=q(e)&&!q(t),i=Object.keys(n._attachments);return r?t.get(n._id).then(function(r){return mi.all(i.map(function(i){return Hr(r,n,i)?e.getAttachment(n._id,i):t.getAttachment(r._id,i)}))}).catch(function(t){if(404!==t.status)throw t;return Wr(e,n)}):Wr(e,n)}function Vr(t){var e=[];return Object.keys(t).forEach(function(n){t[n].missing.forEach(function(t){e.push({id:n,rev:t})})}),{docs:e,revs:!0,latest:!0}}function Gr(t,e,n,r){function i(){var i=Vr(n);if(i.docs.length)return t.bulkGet(i).then(function(n){if(r.cancelled)throw new Error("cancelled");return mi.all(n.results.map(function(n){return mi.all(n.docs.map(function(n){var r=n.ok;return n.error&&(h=!1),r&&r._attachments?Br(e,t,r).then(function(t){var e=Object.keys(r._attachments);return t.forEach(function(t,n){var i=r._attachments[e[n]];delete i.stub,delete i.length,i.data=t}),r}):r}))})).then(function(t){f=f.concat(j(t).filter(Boolean))})})}function o(t){return t._attachments&&Object.keys(t._attachments).length>0}function s(t){return t._conflicts&&t._conflicts.length>0}function a(e){return t.allDocs({keys:e,include_docs:!0,conflicts:!0}).then(function(t){if(r.cancelled)throw new Error("cancelled");t.rows.forEach(function(t){t.deleted||!t.doc||!Ur(t.value.rev)||o(t.doc)||s(t.doc)||(t.doc._conflicts&&delete t.doc._conflicts,f.push(t.doc),delete n[t.id])})})}function u(){var t=Object.keys(n).filter(function(t){var e=n[t].missing;return 1===e.length&&Ur(e[0])});if(t.length>0)return a(t)}function l(){return{ok:h,docs:f}}n=c(n);var f=[],h=!0;return mi.resolve().then(u).then(i).then(l)}function Kr(t,e,n,r,i){return t.get(e).catch(function(n){if(404===n.status)return"http"!==t.adapter&&"https"!==t.adapter||I(404,"PouchDB is just checking if a remote checkpoint exists."),{session_id:r,_id:e,history:[],replicator:Zo,version:Jo};throw n}).then(function(o){if(!i.cancelled&&o.last_seq!==n)return o.history=(o.history||[]).filter(function(t){return t.session_id!==r}),o.history.unshift({last_seq:n,session_id:r}),o.history=o.history.slice(0,ts),o.version=Jo,o.replicator=Zo,o.session_id=r,o.last_seq=n,t.put(o).catch(function(o){if(409===o.status)return Kr(t,e,n,r,i);throw o})})}function $r(t,e,n,r,i){this.src=t,this.target=e,this.id=n,this.returnValue=r,this.opts=i||{}}function Xr(t,e){return t.session_id===e.session_id?{last_seq:t.last_seq,history:t.history}:zr(t.history,e.history)}function zr(t,e){var n=t[0],r=t.slice(1),i=e[0],o=e.slice(1);return n&&0!==e.length?Yr(n.session_id,e)?{last_seq:n.last_seq,history:t}:Yr(i.session_id,r)?{last_seq:i.last_seq,history:o}:zr(r,o):{last_seq:es,history:[]}}function Yr(t,e){var n=e[0],r=e.slice(1);return!(!t||0===e.length)&&(t===n.session_id||Yr(t,r))}function Qr(t){return"number"==typeof t.status&&4===Math.floor(t.status/100)}function Jr(t,e,n,r){if(!1===t.retry)return e.emit("error",n),void e.removeAllListeners();if("function"!=typeof t.back_off_function&&(t.back_off_function=A),e.emit("requestError",n),"active"===e.state||"pending"===e.state){e.emit("paused",n),e.state="stopped";var i=function(){t.current_back_off=rs},o=function(){e.removeListener("active",i)};e.once("paused",o),e.once("active",i)}t.current_back_off=t.current_back_off||rs,t.current_back_off=t.back_off_function(t.current_back_off),setTimeout(r,t.current_back_off)}function Zr(t){return Object.keys(t).sort(Bt).reduce(function(e,n){return e[n]=t[n],e},{})}function ti(t,e,n){var r=n.doc_ids?n.doc_ids.sort(Bt):"",i=n.filter?n.filter.toString():"",o="",s="",a="";return n.selector&&(a=JSON.stringify(n.selector)),n.filter&&n.query_params&&(o=JSON.stringify(Zr(n.query_params))),n.filter&&"_view"===n.filter&&(s=n.view.toString()),mi.all([t.id(),e.id()]).then(function(t){var e=t[0]+t[1]+i+s+o+r+a;return new mi(function(t){Ue(e,t)})}).then(function(t){return"_local/"+(t=t.replace(/\//g,".").replace(/\+/g,"_"))})}function ei(t,e,n,r,i){function o(){return T?mi.resolve():ti(t,e,n).then(function(i){w=i;var o={};o=!1===n.checkpoint?{writeSourceCheckpoint:!1,writeTargetCheckpoint:!1}:"source"===n.checkpoint?{writeSourceCheckpoint:!0,writeTargetCheckpoint:!1}:"target"===n.checkpoint?{writeSourceCheckpoint:!1,writeTargetCheckpoint:!0}:{writeSourceCheckpoint:!0,writeTargetCheckpoint:!0},T=new $r(t,e,w,r,o)})}function s(){if(F=[],0!==E.docs.length){var t=E.docs,o={timeout:n.timeout};return e.bulkDocs({docs:t,new_edits:!1},o).then(function(e){if(r.cancelled)throw p(),new Error("cancelled");var n=Object.create(null);e.forEach(function(t){t.error&&(n[t.id]=t)});var o=Object.keys(n).length;i.doc_write_failures+=o,i.docs_written+=t.length-o,t.forEach(function(t){var e=n[t._id];if(e){i.errors.push(e);var o=(e.name||"").toLowerCase();if("unauthorized"!==o&&"forbidden"!==o)throw e;r.emit("denied",c(e))}else F.push(t)})},function(e){throw i.doc_write_failures+=t.length,e})}}function a(){if(E.error)throw new Error("There was a problem getting docs.");i.last_seq=D=E.seq;var t=c(i);return F.length&&(t.docs=F,"number"==typeof E.pending&&(t.pending=E.pending,delete E.pending),r.emit("change",t)),O=!0,T.writeCheckpoint(E.seq,M).then(function(){if(O=!1,r.cancelled)throw p(),new Error("cancelled");E=void 0,_()}).catch(function(t){throw b(t),t})}function u(){var t={};return E.changes.forEach(function(e){"_user/"!==e.id&&(t[e.id]=e.changes.map(function(t){return t.rev}))}),e.revsDiff(t).then(function(t){if(r.cancelled)throw p(),new Error("cancelled");E.diffs=t})}function l(){return Gr(t,e,E.diffs,r).then(function(t){E.error=!t.ok,t.docs.forEach(function(t){delete E.diffs[t._id],i.docs_read++,E.docs.push(t)})})}function f(){if(!r.cancelled&&!E){if(0===C.length)return void h(!0);E=C.shift(),u().then(l).then(s).then(a).then(f).catch(function(t){d("batch processing terminated with error",t)})}}function h(t){if(0===S.changes.length)return void(0!==C.length||E||((x&&H.live||A)&&(r.state="pending",r.emit("paused")),A&&p()));(t||A||S.changes.length>=N)&&(C.push(S),S={seq:0,changes:[],docs:[]},"pending"!==r.state&&"stopped"!==r.state||(r.state="active",r.emit("active")),f())}function d(t,e){I||(e.message||(e.message=t),i.ok=!1,i.status="aborting",C=[],S={seq:0,changes:[],docs:[]},p(e))}function p(o){if(!(I||r.cancelled&&(i.status="cancelled",O)))if(i.status=i.status||"complete",i.end_time=new Date,i.last_seq=D,I=!0,o){o=k(o),o.result=i;var s=(o.name||"").toLowerCase();"unauthorized"===s||"forbidden"===s?(r.emit("error",o),r.removeAllListeners()):Jr(n,r,o,function(){ei(t,e,n,r)})}else r.emit("complete",i),r.removeAllListeners()}function v(t,e,i){if(r.cancelled)return p();"number"==typeof e&&(S.pending=e),L(n)(t)&&(S.seq=t.seq||i,S.changes.push(t),h(0===C.length&&H.live))}function g(t){if(R=!1,r.cancelled)return p();if(t.results.length>0)H.since=t.last_seq,_(),h(!0);else{var e=function(){x?(H.live=!0,_()):A=!0,h(!0)};E||0!==t.results.length?e():(O=!0,T.writeCheckpoint(t.last_seq,M).then(function(){O=!1,i.last_seq=D=t.last_seq,e()}).catch(b))}}function m(t){if(R=!1,r.cancelled)return p();d("changes rejected",t)}function _(){function e(){o.cancel()}function i(){r.removeListener("cancel",e)}if(!R&&!A&&C.length<j){R=!0,r._changes&&(r.removeListener("cancel",r._abortChanges),r._changes.cancel()),r.once("cancel",e);var o=t.changes(H).on("change",v);o.then(i,i),o.then(g).catch(m),n.retry&&(r._changes=o,r._abortChanges=e)}}function y(){o().then(function(){return r.cancelled?void p():T.getCheckpoint().then(function(t){D=t,H={since:D,limit:N,batch_size:N,style:"all_docs",doc_ids:q,selector:P,return_docs:!0},!1!==U&&(H.seq_interval=U||N),n.filter&&("string"!=typeof n.filter?H.include_docs=!0:H.filter=n.filter),"heartbeat"in n&&(H.heartbeat=n.heartbeat),"timeout"in n&&(H.timeout=n.timeout),n.query_params&&(H.query_params=n.query_params),n.view&&(H.view=n.view),_()})}).catch(function(t){d("getCheckpoint rejected with ",t)})}function b(t){O=!1,d("writeCheckpoint completed with error",t)}var E,w,T,C=[],S={seq:0,changes:[],docs:[]},O=!1,A=!1,I=!1,D=0,x=n.continuous||n.live||!1,N=n.batch_size||100,j=n.batches_limit||10,R=!1,q=n.doc_ids,P=n.selector,F=[],M=Ki(),U=n.seq_interval;i=i||{ok:!0,start_time:new Date,docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};var H={};if(r.ready(t,e),r.cancelled)return void p();r._addedListeners||(r.once("cancel",p),"function"==typeof n.complete&&(r.once("error",n.complete),r.once("complete",function(t){n.complete(null,t)})),r._addedListeners=!0),void 0===n.since?y():o().then(function(){return O=!0,T.writeCheckpoint(n.since,M)}).then(function(){if(O=!1,r.cancelled)return void p();D=n.since,y()}).catch(b)}function ni(){fi.EventEmitter.call(this),this.cancelled=!1,this.state="pending";var t=this,e=new mi(function(e,n){t.once("complete",e),t.once("error",n)});t.then=function(t,n){return e.then(t,n)},t.catch=function(t){return e.catch(t)},t.catch(function(){})}function ri(t,e){var n=e.PouchConstructor;return"string"==typeof t?new n(t,e):t}function ii(t,e,n,r){if("function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),n.doc_ids&&!Array.isArray(n.doc_ids))throw k(qi,"`doc_ids` filter parameter is not a list.");n.complete=r,n=c(n),n.continuous=n.continuous||n.live,n.retry="retry"in n&&n.retry,n.PouchConstructor=n.PouchConstructor||this;var i=new ni(n);return ei(ri(t,n),ri(e,n),n,i),i}function oi(t,e,n,r){return"function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),n=c(n),n.PouchConstructor=n.PouchConstructor||this,t=ri(t,n),e=ri(e,n),new si(t,e,n,r)}function si(t,e,n,r){function i(t){p.emit("change",{direction:"pull",change:t})}function o(t){p.emit("change",{direction:"push",change:t})}function s(t){p.emit("denied",{direction:"push",doc:t})}function a(t){p.emit("denied",{direction:"pull",doc:t})}function c(){p.pushPaused=!0,p.pullPaused&&p.emit("paused")}function u(){p.pullPaused=!0,p.pushPaused&&p.emit("paused")}function l(){p.pushPaused=!1,p.pullPaused&&p.emit("active",{direction:"push"})}function f(){p.pullPaused=!1,p.pushPaused&&p.emit("active",{direction:"pull"})}function h(t){return function(e,n){var r="change"===e&&(n===i||n===o),h="denied"===e&&(n===a||n===s),d="paused"===e&&(n===u||n===c),v="active"===e&&(n===f||n===l);(r||h||d||v)&&(e in m||(m[e]={}),m[e][t]=!0,2===Object.keys(m[e]).length&&p.removeAllListeners(e))}}function d(t,e,n){-1==t.listeners(e).indexOf(n)&&t.on(e,n)}var p=this;this.canceled=!1;var v=n.push?Si({},n,n.push):n,g=n.pull?Si({},n,n.pull):n;this.push=ii(t,e,v),this.pull=ii(e,t,g),this.pushPaused=!0,this.pullPaused=!0;var m={};n.live&&(this.push.on("complete",p.pull.cancel.bind(p.pull)),this.pull.on("complete",p.push.cancel.bind(p.push))),this.on("newListener",function(t){"change"===t?(d(p.pull,"change",i),d(p.push,"change",o)):"denied"===t?(d(p.pull,"denied",a),d(p.push,"denied",s)):"active"===t?(d(p.pull,"active",f),d(p.push,"active",l)):"paused"===t&&(d(p.pull,"paused",u),d(p.push,"paused",c))}),this.on("removeListener",function(t){"change"===t?(p.pull.removeListener("change",i),p.push.removeListener("change",o)):"denied"===t?(p.pull.removeListener("denied",a),p.push.removeListener("denied",s)):"active"===t?(p.pull.removeListener("active",f),p.push.removeListener("active",l)):"paused"===t&&(p.pull.removeListener("paused",u),p.push.removeListener("paused",c))}),this.pull.on("removeListener",h("pull")),this.push.on("removeListener",h("push"));var _=mi.all([this.push,this.pull]).then(function(t){var e={push:t[0],pull:t[1]};return p.emit("complete",e),r&&r(null,e),p.removeAllListeners(),e},function(t){if(p.cancel(),r?r(t):p.emit("error",t),p.removeAllListeners(),r)throw t});this.then=function(t,e){return _.then(t,e)},this.catch=function(t){return _.catch(t)}}function ai(t){t.replicate=ii,t.sync=oi,Object.defineProperty(t.prototype,"replicate",{get:function(){var t=this;return void 0===this.replicateMethods&&(this.replicateMethods={from:function(e,n,r){return t.constructor.replicate(e,t,n,r)},to:function(e,n,r){return t.constructor.replicate(t,e,n,r)}}),this.replicateMethods}}),t.prototype.sync=function(t,e,n){return this.constructor.sync(this,t,e,n)}}var ci=r(t(7)),ui=r(t(1)),li=r(t(5)),fi=t(4),hi=r(t(6)),di=r(t(11)),pi=r(t(2)),vi=r(t(10)),gi=r(t(16)),mi="function"==typeof Promise?Promise:ci,_i=Function.prototype.toString,yi=_i.call(Object);v.prototype.get=function(t){var e=d(t);return this._store[e]},v.prototype.set=function(t,e){var n=d(t);return this._store[n]=e,!0},v.prototype.has=function(t){return d(t)in this._store},v.prototype.delete=function(t){var e=d(t),n=e in this._store;return delete this._store[e],n},v.prototype.forEach=function(t){for(var e=Object.keys(this._store),n=0,r=e.length;n<r;n++){var i=e[n],o=this._store[i];i=p(i),t(o,i)}},Object.defineProperty(v.prototype,"size",{get:function(){return Object.keys(this._store).length}}),g.prototype.add=function(t){return this._store.set(t,!0)},g.prototype.has=function(t){return this._store.has(t)},g.prototype.forEach=function(t){this._store.forEach(function(e,n){t(n)})},Object.defineProperty(g.prototype,"size",{get:function(){return this._store.size}});var bi,Ei;!function(){if("undefined"==typeof Symbol||"undefined"==typeof Map||"undefined"==typeof Set)return!1;var t=Object.getOwnPropertyDescriptor(Map,Symbol.species);return t&&"get"in t&&Map[Symbol.species]===Map}()?(bi=g,Ei=v):(bi=Set,Ei=Map);var wi,Ti=6;if(E())wi=!1;else try{localStorage.setItem("_pouch_check_localstorage",1),wi=!!localStorage.getItem("_pouch_check_localstorage")}catch(t){wi=!1}hi(C,fi.EventEmitter),C.prototype.addListener=function(t,e,n,r){function i(){function t(){s=!1}if(o._listeners[e]){if(s)return void(s="waiting");s=!0;var a=m(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary"]);n.changes(a).on("change",function(t){t.seq>r.since&&!r.cancelled&&(r.since=t.seq,r.onChange(t))}).on("complete",function(){"waiting"===s&&li(i),s=!1}).on("error",t)}}if(!this._listeners[e]){var o=this,s=!1;this._listeners[e]=i,this.on(t,i)}},C.prototype.removeListener=function(t,e){e in this._listeners&&(fi.EventEmitter.prototype.removeListener.call(this,t,this._listeners[e]),delete this._listeners[e])},C.prototype.notifyLocalWindows=function(t){E()?chrome.storage.local.set({dbName:t}):w()&&(localStorage[t]="a"===localStorage[t]?"b":"a")},C.prototype.notify=function(t){this.emit(t),this.notifyLocalWindows(t)};var Ci;Ci="function"==typeof Object.assign?Object.assign:function(t){for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};var Si=Ci;hi(D,Error),D.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})};var Oi=(new D(401,"unauthorized","Name or password is incorrect."),new D(400,"bad_request","Missing JSON list of 'docs'")),Ai=new D(404,"not_found","missing"),Ii=new D(409,"conflict","Document update conflict"),Di=new D(400,"bad_request","_id field must contain a string"),ki=new D(412,"missing_id","_id is required for puts"),xi=new D(400,"bad_request","Only reserved document ids may start with underscore."),Ni=(new D(412,"precondition_failed","Database not open"),new D(500,"unknown_error","Database encountered an unknown error")),Li=new D(500,"badarg","Some query argument is invalid"),ji=(new D(400,"invalid_request","Request was invalid"),new D(400,"query_parse_error","Some query parameter is invalid")),Ri=new D(500,"doc_validation","Bad special document member"),qi=new D(400,"bad_request","Something wrong with the request"),Pi=new D(400,"bad_request","Document must be a JSON object"),Fi=(new D(404,"not_found","Database not found"),new D(500,"indexed_db_went_bad","unknown")),Mi=new D(500,"web_sql_went_bad","unknown"),Ui=(new D(500,"levelDB_went_went_bad","unknown"),new D(403,"forbidden","Forbidden by design doc validate_doc_update function"),new D(400,"bad_request","Invalid rev format")),Hi=(new D(412,"file_exists","The database could not be created, the file already exists."),new D(412,"missing_stub","A pre-existing attachment stub wasn't found")),Wi=(new D(413,"invalid_url","Provided URL is invalid"),["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]),Bi="queryKey",Vi=/(?:^|&)([^&=]*)=?([^&]*)/g,Gi=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ki=di.v4;hi(dt,fi.EventEmitter),dt.prototype.cancel=function(){this.isCancelled=!0,this.db.taskqueue.isReady&&this.emit("cancel")},dt.prototype.validateChanges=function(t){var e=t.complete,n=this;At._changesFilterPlugin?At._changesFilterPlugin.validate(t,function(r){if(r)return e(r);n.doChanges(t)}):n.doChanges(t)},dt.prototype.doChanges=function(t){var e=this,n=t.complete;if(t=c(t),"live"in t&&!("continuous"in t)&&(t.continuous=t.live),t.processChange=pt,"latest"===t.since&&(t.since="now"),t.since||(t.since=0),"now"===t.since)return void this.db.info().then(function(r){if(e.isCancelled)return void n(null,{status:"cancelled"});t.since=r.update_seq,e.doChanges(t)},n);if(At._changesFilterPlugin){if(At._changesFilterPlugin.normalize(t),At._changesFilterPlugin.shouldFilter(this,t))return At._changesFilterPlugin.filter(this,t)}else["doc_ids","filter","selector","view"].forEach(function(e){e in t&&S("warn",'The "'+e+'" option was passed in to changes/replicate, but pouchdb-changes-filter plugin is not installed, so it was ignored. Please install the plugin to enable filtering.')});"descending"in t||(t.descending=!1),t.limit=0===t.limit?1:t.limit,t.complete=n;var r=this.db._changes(t);if(r&&"function"==typeof r.cancel){var i=e.cancel;e.cancel=ui(function(t){r.cancel(),i.apply(this,t)})}},hi(Tt,fi.EventEmitter),Tt.prototype.post=h("post",function(t,e,n){if("function"==typeof e&&(n=e,e={}),"object"!=typeof t||Array.isArray(t))return n(k(Pi));this.bulkDocs({docs:[t]},e,gt(n,t._id))}),Tt.prototype.put=h("put",function(t,e,n){function r(n){"function"==typeof i._put&&!1!==e.new_edits?i._put(t,e,n):i.bulkDocs({docs:[t]},e,gt(n,t._id))}if("function"==typeof e&&(n=e,e={}),"object"!=typeof t||Array.isArray(t))return n(k(Pi));if(R(t._id),lt(t._id)&&"function"==typeof this._putLocal)return t._deleted?this._removeLocal(t,n):this._putLocal(t,n);var i=this;e.force&&t._rev?(function(){var n=t._rev.split("-"),r=n[1],i=parseInt(n[0],10),o=i+1,s=V();t._revisions={start:o,ids:[s,r]},t._rev=o+"-"+s,e.new_edits=!1}(),r(function(e){var r=e?null:{ok:!0,id:t._id,rev:t._rev};n(e,r)})):r(n)}),Tt.prototype.putAttachment=h("putAttachment",function(t,e,n,r,i){function o(t){var n="_rev"in t?parseInt(t._rev,10):0;return t._attachments=t._attachments||{},t._attachments[e]={content_type:i,data:r,revpos:++n},s.put(t)}var s=this;return"function"==typeof i&&(i=r,r=n,n=null),void 0===i&&(i=r,r=n,n=null),i||S("warn","Attachment",e,"on document",t,"is missing content_type"),s.get(t).then(function(t){if(t._rev!==n)throw k(Ii);return o(t)},function(e){if(e.reason===Ai.message)return o({_id:t});throw e})}),Tt.prototype.removeAttachment=h("removeAttachment",function(t,e,n,r){var i=this;i.get(t,function(t,o){return t?void r(t):o._rev!==n?void r(k(Ii)):o._attachments?(delete o._attachments[e],0===Object.keys(o._attachments).length&&delete o._attachments,void i.put(o,r)):r()})}),Tt.prototype.remove=h("remove",function(t,e,n,r){var i;"string"==typeof e?(i={_id:t,_rev:e},"function"==typeof n&&(r=n,n={})):(i=t,"function"==typeof e?(r=e,n={}):(r=n,n=e)),n=n||{},n.was_delete=!0;var o={_id:i._id,_rev:i._rev||n.rev};if(o._deleted=!0,lt(o._id)&&"function"==typeof this._removeLocal)return this._removeLocal(i,r);this.bulkDocs({docs:[o]},n,gt(r,o._id))}),Tt.prototype.revsDiff=h("revsDiff",function(t,e,n){function r(t,e){a.has(t)||a.set(t,{missing:[]}),a.get(t).missing.push(e)}function i(e,n){var i=t[e].slice(0);K(n,function(t,n,o,s,a){var c=n+"-"+o,u=i.indexOf(c);-1!==u&&(i.splice(u,1),"available"!==a.status&&r(e,c))}),i.forEach(function(t){r(e,t)})}"function"==typeof e&&(n=e,e={});var o=Object.keys(t);if(!o.length)return n(null,{});var s=0,a=new Ei;o.map(function(e){this._getRevisionTree(e,function(r,c){if(r&&404===r.status&&"missing"===r.message)a.set(e,{missing:t[e]});else{if(r)return n(r);i(e,c)}if(++s===o.length){var u={};return a.forEach(function(t,e){u[e]=t}),n(null,u)}})},this)}),Tt.prototype.bulkGet=h("bulkGet",function(t,e){b(this,t,e)}),Tt.prototype.compactDocument=h("compactDocument",function(t,e,n){var r=this;this._getRevisionTree(t,function(i,o){if(i)return n(i);var s=yt(o),a=[],c=[];Object.keys(s).forEach(function(t){s[t]>e&&a.push(t)}),K(o,function(t,e,n,r,i){var o=e+"-"+n;"available"===i.status&&-1!==a.indexOf(o)&&c.push(o)}),r._doCompaction(t,c,n)})}),Tt.prototype.compact=h("compact",function(t,e){"function"==typeof t&&(e=t,t={});var n=this;t=t||{},n._compactionQueue=n._compactionQueue||[],n._compactionQueue.push({opts:t,callback:e}),1===n._compactionQueue.length&&Et(n)}),Tt.prototype._compact=function(t,e){function n(t){s.push(i.compactDocument(t.id,0))}function r(t){var n=t.last_seq;mi.all(s).then(function(){return W(i,"_local/compaction",function(t){return(!t.last_seq||t.last_seq<n)&&(t.last_seq=n,t)})}).then(function(){e(null,{ok:!0})}).catch(e)}var i=this,o={return_docs:!1,last_seq:t.last_seq||0},s=[];i.changes(o).on("change",n).on("complete",r).on("error",e)},Tt.prototype.get=h("get",function(t,e,n){function r(){var r=[],s=i.length;if(!s)return n(null,r);i.forEach(function(i){o.get(t,{rev:i,revs:e.revs,latest:e.latest,attachments:e.attachments,binary:e.binary},function(t,e){if(t)r.push({missing:i});else{for(var o,a=0,c=r.length;a<c;a++)if(r[a].ok&&r[a].ok._rev===e._rev){o=!0;break}o||r.push({ok:e})}--s||n(null,r)})})}if("function"==typeof e&&(n=e,e={}),"string"!=typeof t)return n(k(Di));if(lt(t)&&"function"==typeof this._getLocal)return this._getLocal(t,n);var i=[],o=this;if(!e.open_revs)return this._get(t,e,function(r,i){if(r)return r.docId=t,n(r);var s=i.doc,a=i.metadata,c=i.ctx;if(e.conflicts){var u=z(a);u.length&&(s._conflicts=u)}if(ut(a,s._rev)&&(s._deleted=!0),e.revs||e.revs_info){for(var l=s._rev.split("-"),f=parseInt(l[0],10),h=l[1],d=Q(a.rev_tree),p=null,v=0;v<d.length;v++){var g=d[v],m=g.ids.map(function(t){return t.id}).indexOf(h);(m===f-1||!p&&-1!==m)&&(p=g)}var _=p.ids.map(function(t){return t.id}).indexOf(s._rev.split("-")[1])+1,y=p.ids.length-_;if(p.ids.splice(_,y),p.ids.reverse(),e.revs&&(s._revisions={start:p.pos+p.ids.length-1,ids:p.ids.map(function(t){return t.id})}),e.revs_info){var b=p.pos+p.ids.length;s._revs_info=p.ids.map(function(t){return b--,{rev:b+"-"+t.id,status:t.opts.status}})}}if(e.attachments&&s._attachments){var E=s._attachments,w=Object.keys(E).length;if(0===w)return n(null,s);Object.keys(E).forEach(function(t){this._getAttachment(s._id,t,E[t],{rev:s._rev,binary:e.binary,ctx:c},function(e,r){var i=s._attachments[t];i.data=r,delete i.stub,delete i.length,--w||n(null,s)})},o)}else{if(s._attachments)for(var T in s._attachments)s._attachments.hasOwnProperty(T)&&(s._attachments[T].stub=!0);n(null,s)}});if("all"===e.open_revs)this._getRevisionTree(t,function(t,e){if(t)return n(t);i=X(e).map(function(t){return t.rev}),r()});else{if(!Array.isArray(e.open_revs))return n(k(Ni,"function_clause"));i=e.open_revs;for(var s=0;s<i.length;s++){var a=i[s];if("string"!=typeof a||!/^\d+-/.test(a))return n(k(Ui))}r()}}),Tt.prototype.getAttachment=h("getAttachment",function(t,e,n,r){var i=this;n instanceof Function&&(r=n,n={}),this._get(t,n,function(o,s){return o?r(o):s.doc._attachments&&s.doc._attachments[e]?(n.ctx=s.ctx,n.binary=!0,void i._getAttachment(t,e,s.doc._attachments[e],n,r)):r(k(Ai))})}),Tt.prototype.allDocs=h("allDocs",function(t,e){if("function"==typeof t&&(e=t,t={}),t.skip=void 0!==t.skip?t.skip:0,t.start_key&&(t.startkey=t.start_key),t.end_key&&(t.endkey=t.end_key),"keys"in t){if(!Array.isArray(t.keys))return e(new TypeError("options.keys must be an array"));var n=["startkey","endkey","key"].filter(function(e){return e in t})[0];if(n)return void e(k(ji,"Query parameter `"+n+"` is not compatible with multi-get"));if(!q(this)&&(bt(t),0===t.keys.length))return this._allDocs({limit:0},e)}return this._allDocs(t,e)}),Tt.prototype.changes=function(t,e){return"function"==typeof t&&(e=t,t={}),new dt(this,t,e)},Tt.prototype.close=h("close",function(t){return this._closed=!0,this.emit("closed"),this._close(t)}),Tt.prototype.info=h("info",function(t){var e=this;this._info(function(n,r){if(n)return t(n);r.db_name=r.db_name||e.name,r.auto_compaction=!(!e.auto_compaction||q(e)),r.adapter=e.adapter,t(null,r)})}),Tt.prototype.id=h("id",function(t){return this._id(t)}),Tt.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},Tt.prototype.bulkDocs=h("bulkDocs",function(t,e,n){if("function"==typeof e&&(n=e,e={}),e=e||{},Array.isArray(t)&&(t={docs:t}),!t||!t.docs||!Array.isArray(t.docs))return n(k(Oi));for(var r=0;r<t.docs.length;++r)if("object"!=typeof t.docs[r]||Array.isArray(t.docs[r]))return n(k(Pi));var i;if(t.docs.forEach(function(t){t._attachments&&Object.keys(t._attachments).forEach(function(e){i=i||wt(e),t._attachments[e].content_type||S("warn","Attachment",e,"on document",t._id,"is missing content_type")})}),i)return n(k(qi,i));"new_edits"in e||(e.new_edits=!("new_edits"in t)||t.new_edits);var o=this;e.new_edits||q(o)||t.docs.sort(_t),mt(t.docs);var s=t.docs.map(function(t){return t._id});return this._bulkDocs(t,e,function(t,r){if(t)return n(t);if(e.new_edits||(r=r.filter(function(t){return t.error})),!q(o))for(var i=0,a=r.length;i<a;i++)r[i].id=r[i].id||s[i];n(null,r)})}),Tt.prototype.registerDependentDatabase=h("registerDependentDatabase",function(t,e){function n(e){return e.dependentDbs=e.dependentDbs||{},!e.dependentDbs[t]&&(e.dependentDbs[t]=!0,e)}var r=new this.constructor(t,this.__opts);W(this,"_local/_pouch_dependentDbs",n).then(function(){e(null,{db:r})}).catch(e)}),Tt.prototype.destroy=h("destroy",function(t,e){function n(){r._destroy(t,function(t,n){if(t)return e(t);r._destroyed=!0,r.emit("destroyed"),e(null,n||{ok:!0})})}"function"==typeof t&&(e=t,t={});var r=this,i=!("use_prefix"in r)||r.use_prefix;if(q(r))return n();r.get("_local/_pouch_dependentDbs",function(t,o){if(t)return 404!==t.status?e(t):n();var s=o.dependentDbs,a=r.constructor,c=Object.keys(s).map(function(t){var e=i?t.replace(new RegExp("^"+a.prefix),""):t;return new a(e,r.__opts).destroy()});mi.all(c).then(n,e)})}),Ct.prototype.execute=function(){var t;if(this.failed)for(;t=this.queue.shift();)t(this.failed);else for(;t=this.queue.shift();)t()},Ct.prototype.fail=function(t){this.failed=t,this.execute()},Ct.prototype.ready=function(t){this.isReady=!0,this.db=t,this.execute()},Ct.prototype.addTask=function(t){this.queue.push(t),this.failed&&this.execute()},hi(At,Tt),At.adapters={},At.preferredAdapters=[],At.prefix="_pouch_";var $i=new fi.EventEmitter;!function(t){Object.keys(fi.EventEmitter.prototype).forEach(function(e){"function"==typeof fi.EventEmitter.prototype[e]&&(t[e]=$i[e].bind($i))});var e=t._destructionListeners=new Ei;t.on("ref",function(t){e.has(t.name)||e.set(t.name,[]),e.get(t.name).push(t)}),t.on("unref",function(t){if(e.has(t.name)){var n=e.get(t.name),r=n.indexOf(t);r<0||(n.splice(r,1),n.length>1?e.set(t.name,n):e.delete(t.name))}}),t.on("destroyed",function(t){if(e.has(t)){var n=e.get(t);e.delete(t),n.forEach(function(t){t.emit("destroyed",!0)})}})}(At),At.adapter=function(t,e,n){e.valid()&&(At.adapters[t]=e,n&&At.preferredAdapters.push(t))},At.plugin=function(t){if("function"==typeof t)t(At);else{if("object"!=typeof t||0===Object.keys(t).length)throw new Error('Invalid plugin: got "'+t+'", expected an object or a function');Object.keys(t).forEach(function(e){At.prototype[e]=t[e]})}return this.__defaults&&(At.__defaults=Si({},this.__defaults)),At},At.defaults=function(t){function e(t,n){if(!(this instanceof e))return new e(t,n);n=n||{},t&&"object"==typeof t&&(n=t,t=n.name,delete n.name),n=Si({},e.__defaults,n),At.call(this,t,n)}return hi(e,At),e.preferredAdapters=At.preferredAdapters.slice(),Object.keys(At).forEach(function(t){t in e||(e[t]=At[t])}),e.__defaults=Si({},this.__defaults,t),e};var Xi=["$or","$nor","$not"],zi=-324,Yi=3,Qi="",Ji={$elemMatch:function(t,e,n,r){return!!Array.isArray(r)&&0!==r.length&&("object"==typeof r[0]?r.some(function(t){return re(t,e,Object.keys(e))}):r.some(function(r){return ie(e,t,n,r)}))},$allMatch:function(t,e,n,r){return!!Array.isArray(r)&&0!==r.length&&("object"==typeof r[0]?r.every(function(t){return re(t,e,Object.keys(e))}):r.every(function(r){return ie(e,t,n,r)}))},$eq:function(t,e,n,r){return ce(r)&&0===Bt(r,e)},$gte:function(t,e,n,r){return ce(r)&&Bt(r,e)>=0},$gt:function(t,e,n,r){return ce(r)&&Bt(r,e)>0},$lte:function(t,e,n,r){return ce(r)&&Bt(r,e)<=0},$lt:function(t,e,n,r){return ce(r)&&Bt(r,e)<0},$exists:function(t,e,n,r){return e?ce(r):!ce(r)},$mod:function(t,e,n,r){return ae(r)&&ue(r,e)},$ne:function(t,e,n,r){return e.every(function(t){return 0!==Bt(r,t)})},$in:function(t,e,n,r){return ae(r)&&le(r,e)},$nin:function(t,e,n,r){return ae(r)&&!le(r,e)},$size:function(t,e,n,r){return ae(r)&&he(r,e)},$all:function(t,e,n,r){return Array.isArray(r)&&fe(r,e)},$regex:function(t,e,n,r){return ae(r)&&de(r,e)},$type:function(t,e,n,r){return pe(r,e)}};At.plugin(It),At.plugin(we),At.version="6.4.3";var Zi,to=Te(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats","_removed"]),eo=Te(["_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]),no=function(t){return atob(t)},ro=function(t){return btoa(t)},io=e.setImmediate||e.setTimeout,oo=32768,so=5,ao="document-store",co="by-sequence",uo="attach-store",lo="attach-seq-store",fo="meta-store",ho="local-store",po="detect-blob-support",vo=new C,go=!1,mo=[],_o=new Ei,yo=new Ei;bn.valid=function(){var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");try{return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}};var bo=7,Eo=Dn("document-store"),wo=Dn("by-sequence"),To=Dn("attach-store"),Co=Dn("local-store"),So=Dn("metadata-store"),Oo=Dn("attach-seq-store"),Ao=new Ei,Io=new C,Do=1,ko="CREATE INDEX IF NOT EXISTS 'by-seq-deleted-idx' ON "+wo+" (seq, deleted)",xo="CREATE UNIQUE INDEX IF NOT EXISTS 'by-seq-doc-id-rev' ON "+wo+" (doc_id, rev)",No="CREATE INDEX IF NOT EXISTS 'doc-winningseq-idx' ON "+Eo+" (winningseq)",Lo="CREATE INDEX IF NOT EXISTS 'attach-seq-seq-idx' ON "+Oo+" (seq)",jo="CREATE UNIQUE INDEX IF NOT EXISTS 'attach-seq-digest-idx' ON "+Oo+" (digest, seq)",Ro=wo+".seq = "+Eo+".winningseq",qo=wo+".seq AS seq, "+wo+".deleted AS deleted, "+wo+".json AS data, "+wo+".rev AS rev, "+Eo+".json AS metadata";zn.valid=$n,zn.use_prefix=!0;var Po=function(){try{return new XMLHttpRequest,!0}catch(t){return!1}}(),Fo=25,Mo=50,Uo=5e3,Ho=1e4,Wo={};dr.valid=function(){return!0},hi(vr,Error),hi(gr,Error),hi(mr,Error);var Bo=S.bind(null,"log"),Vo=Array.isArray,Go=JSON.parse;Ar.prototype.add=function(t){return this.promise=this.promise.catch(function(){}).then(function(){return t()}),this.promise},Ar.prototype.finish=function(){return this.promise};var Ko={},$o=new Ar,Xo=50,zo={_sum:function(t,e){return Sr(e)},_count:function(t,e){return e.length},_stats:function(t,e){return{sum:Sr(e),min:Math.min.apply(null,e),max:Math.max.apply(null,e),count:e.length,sumsqr:function(t){for(var e=0,n=0,r=t.length;n<r;n++){var i=t[n];e+=i*i}return e}(e)}}},Yo=function(t,e,n,r){function i(t,e,n){try{e(n)}catch(e){Lr(t,e)}}function o(t,e,n,r,i){try{return{output:e(n,r,i)}}catch(e){return Lr(t,e),{error:e}}}function s(t,e){var n=Bt(t.key,e.key);return 0!==n?n:Bt(t.value,e.value)}function a(t,e,n){return n=n||0,"number"==typeof e?t.slice(n,e+n):n>0?t.slice(n):t}function c(t){var e=t.value;return e&&"object"==typeof e&&e._id||t.id}function u(t){t.rows.forEach(function(t){var e=t.doc&&t.doc._attachments;e&&Object.keys(e).forEach(function(t){var n=e[t];e[t].data=ke(n.data,n.content_type)})})}function l(t){return function(e){return t.include_docs&&t.attachments&&t.binary&&u(e),e}}function f(t,e,n,r){var i=e[t];void 0!==i&&(r&&(i=encodeURIComponent(JSON.stringify(i))),n.push(t+"="+i))}function h(t){if(void 0!==t){var e=Number(t);return isNaN(e)||e!==parseInt(t,10)?t:e}}function d(t){return t.group_level=h(t.group_level),t.limit=h(t.limit),t.skip=h(t.skip),t}function p(t){if(t){if("number"!=typeof t)return new vr('Invalid value for integer: "'+t+'"');if(t<0)return new vr('Invalid value for positive integer: "'+t+'"')}}function v(t,e){var n=t.descending?"endkey":"startkey",r=t.descending?"startkey":"endkey";if(void 0!==t[n]&&void 0!==t[r]&&Bt(t[n],t[r])>0)throw new vr("No rows can match your key range, reverse your start_key and end_key or set {descending : true}");if(e.reduce&&!1!==t.reduce){if(t.include_docs)throw new vr("{include_docs:true} is invalid for reduce");if(t.keys&&t.keys.length>1&&!t.group&&!t.group_level)throw new vr("Multi-key fetches for reduce views must use {group: true}")}["group_level","limit","skip"].forEach(function(e){var n=p(t[e]);if(n)throw n})}function g(t,e,n){var r,i=[],o="GET";if(f("reduce",n,i),f("include_docs",n,i),f("attachments",n,i),f("limit",n,i),f("descending",n,i),f("group",n,i),f("group_level",n,i),f("skip",n,i),f("stale",n,i),f("conflicts",n,i),f("startkey",n,i,!0),f("start_key",n,i,!0),f("endkey",n,i,!0),f("end_key",n,i,!0),f("inclusive_end",n,i),f("key",n,i,!0),f("update_seq",n,i),i=i.join("&"),i=""===i?"":"?"+i,void 0!==n.keys){var s="keys="+encodeURIComponent(JSON.stringify(n.keys));s.length+i.length+1<=2e3?i+=("?"===i[0]?"&":"?")+s:(o="POST","string"==typeof e?r={keys:n.keys}:e.keys=n.keys)}if("string"==typeof e){var a=xr(e);return t.request({method:o,url:"_design/"+a[0]+"/_view/"+a[1]+i,body:r}).then(function(t){return t.rows.forEach(function(t){if(t.value&&t.value.error&&"builtin_reduce_error"===t.value.error)throw new Error(t.reason)}),t}).then(l(n))}return r=r||{},Object.keys(e).forEach(function(t){Array.isArray(e[t])?r[t]=e[t]:r[t]=e[t].toString()}),t.request({method:"POST",url:"_temp_view"+i,body:r}).then(l(n))}function m(t,e,n){return new mi(function(r,i){t._query(e,n,function(t,e){if(t)return i(t);r(e)})})}function _(t){return new mi(function(e,n){t._viewCleanup(function(t,r){if(t)return n(t);e(r)})})}function y(t){return function(e){if(404===e.status)return t;throw e}}function b(t,e,n){function r(t){return t.keys.length?e.db.allDocs({keys:t.keys,include_docs:!0}):mi.resolve({rows:[]})}function i(t,e){for(var n=[],r=new bi,i=0,o=e.rows.length;i<o;i++){var s=e.rows[i],a=s.doc;if(a&&(n.push(a),r.add(a._id),a._deleted=!c.has(a._id),!a._deleted)){var u=c.get(a._id);"value"in u&&(a.value=u.value)}}var l=Tr(c);return l.forEach(function(t){if(!r.has(t)){var e={_id:t},i=c.get(t);"value"in i&&(e.value=i.value),n.push(e)}}),t.keys=wr(l.concat(t.keys)),n.push(t),n}var o="_local/doc_"+t,s={_id:o,keys:[]},a=n.get(t),c=a[0],u=a[1];return function(){return Nr(u)?mi.resolve(s):e.db.get(o).catch(y(s))}().then(function(t){return r(t).then(function(e){return i(t,e)})})}function E(t,e,n){return t.db.get("_local/lastSeq").catch(y({_id:"_local/lastSeq",seq:0})).then(function(r){var i=Tr(e);return mi.all(i.map(function(n){return b(n,t,e)})).then(function(e){var i=j(e);return r.seq=n,i.push(r),t.db.bulkDocs({docs:i})})})}function w(t){var e="string"==typeof t?t:t.name,n=Ko[e];return n||(n=Ko[e]=new Ar),n}function T(t){return Er(w(t),function(){return C(t)})()}function C(t){function n(t,e){var n={id:f._id,key:Vt(t)};void 0!==e&&null!==e&&(n.value=Vt(e)),l.push(n)}function r(e,n){return function(){return E(t,e,n)}}function o(){return t.sourceDB.changes({conflicts:!0,include_docs:!0,style:"all_docs",since:d,limit:Xo}).then(a)}function a(t){var e=t.results;if(e.length){var n=c(e);if(p.add(r(n,d)),!(e.length<Xo))return o()}}function c(e){for(var n=new Ei,r=0,o=e.length;r<o;r++){var a=e[r];if("_"!==a.doc._id[0]){l=[],f=a.doc,f._deleted||i(t.sourceDB,h,f),l.sort(s);var c=u(l);n.set(a.doc._id,[c,a.changes])}d=a.seq}return n}function u(t){for(var e,n=new Ei,r=0,i=t.length;r<i;r++){var o=t[r],s=[o.key,o.id];r>0&&0===Bt(o.key,e)&&s.push(r),n.set(Kt(s),o),e=o.key}return n}var l,f,h=e(t.mapFun,n),d=t.seq||0,p=new Ar;return o().then(function(){return p.finish()}).then(function(){t.seq=d})}function S(t,e,r){0===r.group_level&&delete r.group_level;var i=r.group||r.group_level,s=n(t.reduceFun),c=[],u=isNaN(r.group_level)?Number.POSITIVE_INFINITY:r.group_level;e.forEach(function(t){var e=c[c.length-1],n=i?t.key:null;if(i&&Array.isArray(n)&&(n=n.slice(0,u)),e&&0===Bt(e.groupKey,n))return e.keys.push([t.key,t.id]),void e.values.push(t.value);c.push({keys:[[t.key,t.id]],values:[t.value],groupKey:n})}),e=[];for(var l=0,f=c.length;l<f;l++){var h=c[l],d=o(t.sourceDB,s,h.keys,h.values,!1);if(d.error&&d.error instanceof mr)throw d.error;e.push({value:d.error?null:d.output,key:h.groupKey})}return{rows:a(e,r.limit,r.skip)}}function O(t,e){return Er(w(t),function(){return A(t,e)})()}function A(t,e){function n(e){return e.include_docs=!0,t.db.allDocs(e).then(function(t){return i=t.total_rows,t.rows.map(function(t){if("value"in t.doc&&"object"==typeof t.doc.value&&null!==t.doc.value){var e=Object.keys(t.doc.value).sort(),n=["id","key","value"];if(!(e<n||e>n))return t.doc.value}var r=zt(t.doc._id);return{key:r[0],id:r[1],value:"value"in t.doc?t.doc.value:null}})})}function r(n){var r;if(r=o?S(t,n,e):{total_rows:i,offset:s,rows:n},e.update_seq&&(r.update_seq=t.seq),e.include_docs){var a=wr(n.map(c));return t.sourceDB.allDocs({keys:a,include_docs:!0,conflicts:e.conflicts,attachments:e.attachments,binary:e.binary}).then(function(t){var e=new Ei;return t.rows.forEach(function(t){e.set(t.id,t.doc)}),n.forEach(function(t){var n=c(t),r=e.get(n);r&&(t.doc=r)}),r})}return r}var i,o=t.reduceFun&&!1!==e.reduce,s=e.skip||0;if(void 0===e.keys||e.keys.length||(e.limit=0,delete e.keys),void 0!==e.keys){var a=e.keys,u=a.map(function(t){var r={startkey:Kt([t]),endkey:Kt([t,{}])};return e.update_seq&&(r.update_seq=!0),n(r)});return mi.all(u).then(j).then(r)}var l={descending:e.descending};e.update_seq&&(l.update_seq=!0);var f,h;if("start_key"in e&&(f=e.start_key),"startkey"in e&&(f=e.startkey),"end_key"in e&&(h=e.end_key),"endkey"in e&&(h=e.endkey),void 0!==f&&(l.startkey=Kt(e.descending?[f,{}]:[f])),void 0!==h){var d=!1!==e.inclusive_end;e.descending&&(d=!d),l.endkey=Kt(d?[h,{}]:[h])}if(void 0!==e.key){var p=Kt([e.key]),v=Kt([e.key,{}]);l.descending?(l.endkey=p,l.startkey=v):(l.startkey=p,l.endkey=v)}return o||("number"==typeof e.limit&&(l.limit=e.limit),l.skip=s),n(l).then(r)}function I(t){return t.request({method:"POST",url:"_view_cleanup"})}function D(e){return e.get("_local/"+t).then(function(t){var n=new Ei;Object.keys(t.views).forEach(function(t){var e=xr(t),r="_design/"+e[0],i=e[1],o=n.get(r);o||(o=new bi,n.set(r,o)),o.add(i)});var r={keys:Tr(n),include_docs:!0};return e.allDocs(r).then(function(r){var i={};r.rows.forEach(function(e){var r=e.key.substring(8);n.get(e.key).forEach(function(n){var o=r+"/"+n;t.views[o]||(o=n);var s=Object.keys(t.views[o]),a=e.doc&&e.doc.views&&e.doc.views[n];s.forEach(function(t){i[t]=i[t]||a})})});var o=Object.keys(i).filter(function(t){return!i[t]}),s=o.map(function(t){return Er(w(t),function(){return new e.constructor(t,e.__opts).destroy()})()});return mi.all(s).then(function(){return{ok:!0}})})},y({ok:!0}))}function k(e,n,i){if("function"==typeof e._query)return m(e,n,i);if(q(e))return g(e,n,i);if("string"!=typeof n)return v(i,n),$o.add(function(){return kr(e,"temp_view/temp_view",n.map,n.reduce,!0,t).then(function(t){return br(T(t).then(function(){return O(t,i)}),function(){return t.db.destroy()})})}),$o.finish();var o=n,s=xr(o),a=s[0],c=s[1];return e.get("_design/"+a).then(function(n){var s=n.views&&n.views[c];if(!s)throw new gr("ddoc "+n._id+" has no view named "+c);return r(n,c),v(i,s),kr(e,o,s.map,s.reduce,!1,t).then(function(t){return"ok"===i.stale||"update_after"===i.stale?("update_after"===i.stale&&li(function(){T(t)}),O(t,i)):T(t).then(function(){return O(t,i)})})})}function x(t,e,n){var r=this;"function"==typeof e&&(n=e,e={}),e=e?d(e):{},"function"==typeof t&&(t={map:t});var i=mi.resolve().then(function(){return k(r,t,e)});return _r(i,n),i}return{query:x,viewCleanup:yr(function(){var t=this;return"function"==typeof t._viewCleanup?_(t):q(t)?I(t):D(t)})}}("mrviews",Rr,qr,Pr),Qo={query:Fr,viewCleanup:Mr},Jo=1,Zo="pouchdb",ts=5,es=0;$r.prototype.writeCheckpoint=function(t,e){var n=this;return this.updateTarget(t,e).then(function(){return n.updateSource(t,e)})},$r.prototype.updateTarget=function(t,e){return this.opts.writeTargetCheckpoint?Kr(this.target,this.id,t,e,this.returnValue):mi.resolve(!0)},$r.prototype.updateSource=function(t,e){if(this.opts.writeSourceCheckpoint){var n=this;return Kr(this.src,this.id,t,e,this.returnValue).catch(function(t){if(Qr(t))return n.opts.writeSourceCheckpoint=!1,!0;throw t})}return mi.resolve(!0)};var ns={undefined:function(t,e){return 0===Bt(t.last_seq,e.last_seq)?e.last_seq:0},1:function(t,e){return Xr(e,t).last_seq}};$r.prototype.getCheckpoint=function(){var t=this;return t.opts&&t.opts.writeSourceCheckpoint&&!t.opts.writeTargetCheckpoint?t.src.get(t.id).then(function(t){return t.last_seq||es}).catch(function(t){if(404!==t.status)throw t;return es}):t.target.get(t.id).then(function(e){return t.opts&&t.opts.writeTargetCheckpoint&&!t.opts.writeSourceCheckpoint?e.last_seq||es:t.src.get(t.id).then(function(t){if(e.version!==t.version)return es;var n;return n=e.version?e.version.toString():"undefined",n in ns?ns[n](e,t):es},function(n){if(404===n.status&&e.last_seq)return t.src.put({_id:t.id,last_seq:es}).then(function(){return es},function(n){return Qr(n)?(t.opts.writeSourceCheckpoint=!1,e.last_seq):es});throw n})}).catch(function(t){if(404!==t.status)throw t;return es})};var rs=0;hi(ni,fi.EventEmitter),ni.prototype.cancel=function(){this.cancelled=!0,this.state="cancelled",this.emit("cancel")},ni.prototype.ready=function(t,e){function n(){i.cancel()}function r(){t.removeListener("destroyed",n),e.removeListener("destroyed",n)}var i=this;i._readyCalled||(i._readyCalled=!0,t.once("destroyed",n),e.once("destroyed",n),i.once("complete",r))},hi(si,fi.EventEmitter),si.prototype.cancel=function(){this.canceled||(this.canceled=!0,this.push.cancel(),this.pull.cancel())},At.plugin(Tn).plugin(Yn).plugin(pr).plugin(Qo).plugin(ai),n.exports=At}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1,10:10,11:11,16:16,2:2,4:4,5:5,6:6,7:7}]},{},[17])(17)}()}()}).call(e,n(4))},function(t,e,n){"use strict";(function(t){var e=n(2),r=n.n(e),i=n(24),o=n.n(i);t(window).on(r.a.AJAX+" "+r.a.LOADED,function(){o()({navigation:function(){t("#NavbarCollapse").addClass("in")},"carousel:id:num":function(e,n){t("#Carousel"+e).carousel(n)}})})}).call(e,n(0))},function(t,e,n){"use strict";var r=n(25),i=["get","post","put","patch","delete","del","all"],o=[].slice;t.exports=function(t){var e,n,s,a;return e=o.call(arguments,1),"function"==typeof e[e.length-1]&&(a=e.pop()),n=r.join.apply(r,e),s={},i.forEach(function(e){s[e]=function(r){var i=o.call(arguments);return i.length<2?i.unshift(n):i[0]=n+i[0],t[e].apply(t,i)}}),a&&a(s),s}},function(t,e,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return i.exec(t).slice(1)};e.resolve=function(){for(var e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,i="/"===s.charAt(0))}return e=n(r(e.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(t){var i=e.isAbsolute(t),o="/"===s(t,-1);return t=n(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(r(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),s=Math.min(i.length,o.length),a=s,c=0;c<s;c++)if(i[c]!==o[c]){a=c;break}for(var u=[],c=a;c<i.length;c++)u.push("..");return u=u.concat(o.slice(a)),u.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){var e=o(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},e.basename=function(t,e){var n=o(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){return o(t)[3]};var s="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(e,n(26))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function s(){v&&d&&(v=!1,d.length?p=d.concat(p):g=-1,p.length&&a())}function a(){if(!v){var t=i(s);v=!0;for(var e=p.length;e;){for(d=p,p=[];++g<e;)d&&d[g].run();g=-1,e=p.length}d=null,v=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,f,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(t){f=r}}();var d,p=[],v=!1,g=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new c(t,e)),1!==p.length||v||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,n){(function(n){var r,i;!function(n,o){r=[],void 0!==(i=function(){return o(n)}.apply(e,r))&&(t.exports=i)}(void 0!==n?n:"undefined"!=typeof window?window:this,function(t){"use strict";var e={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},n=function(){return"querySelector"in document&&"addEventListener"in t&&"requestAnimationFrame"in t&&"closest"in t.Element.prototype},r=function(){for(var t={},e=0;e<arguments.length;e++)!function(e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}(arguments[e]);return t},i=function(e){return!!("matchMedia"in t&&t.matchMedia("(prefers-reduced-motion)").matches)},o=function(e){return parseInt(t.getComputedStyle(e).height,10)},s=function(t){var e;try{e=decodeURIComponent(t)}catch(n){e=t}return e},a=function(t){"#"===t.charAt(0)&&(t=t.substr(1));for(var e,n=String(t),r=n.length,i=-1,o="",s=n.charCodeAt(0);++i<r;){if(0===(e=n.charCodeAt(i)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");o+=e>=1&&e<=31||127==e||0===i&&e>=48&&e<=57||1===i&&e>=48&&e<=57&&45===s?"\\"+e.toString(16)+" ":e>=128||45===e||95===e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?n.charAt(i):"\\"+n.charAt(i)}var a;try{a=decodeURIComponent("#"+o)}catch(t){a="#"+o}return a},c=function(t,e){var n;return"easeInQuad"===t.easing&&(n=e*e),"easeOutQuad"===t.easing&&(n=e*(2-e)),"easeInOutQuad"===t.easing&&(n=e<.5?2*e*e:(4-2*e)*e-1),"easeInCubic"===t.easing&&(n=e*e*e),"easeOutCubic"===t.easing&&(n=--e*e*e+1),"easeInOutCubic"===t.easing&&(n=e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1),"easeInQuart"===t.easing&&(n=e*e*e*e),"easeOutQuart"===t.easing&&(n=1- --e*e*e*e),"easeInOutQuart"===t.easing&&(n=e<.5?8*e*e*e*e:1-8*--e*e*e*e),"easeInQuint"===t.easing&&(n=e*e*e*e*e),"easeOutQuint"===t.easing&&(n=1+--e*e*e*e*e),"easeInOutQuint"===t.easing&&(n=e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e),t.customEasing&&(n=t.customEasing(e)),n||e},u=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},l=function(e,n,r,i){var o=0;if(e.offsetParent)do{o+=e.offsetTop,e=e.offsetParent}while(e);return o=Math.max(o-n-r,0),i&&(o=Math.min(o,u()-t.innerHeight)),o},f=function(t){return t?o(t)+t.offsetTop:0},h=function(t,e,n){e||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:t.id},document.title,t===document.documentElement?"#top":"#"+t.id)},d=function(e,n,r){0===e&&document.body.focus(),r||(e.focus(),document.activeElement!==e&&(e.setAttribute("tabindex","-1"),e.focus(),e.style.outline="none"),t.scrollTo(0,n))},p=function(e,n,r,i){if(n.emitEvents&&"function"==typeof t.CustomEvent){var o=new CustomEvent(e,{bubbles:!0,detail:{anchor:r,toggle:i}});document.dispatchEvent(o)}};return function(o,v){var g,m,_,y,b,E,w,T={};T.cancelScroll=function(t){cancelAnimationFrame(w),w=null,t||p("scrollCancel",g)},T.animateScroll=function(n,i,o){var s=r(g||e,o||{}),a="[object Number]"===Object.prototype.toString.call(n),v=a||!n.tagName?null:n;if(a||v){var m=t.pageYOffset;s.header&&!y&&(y=document.querySelector(s.header)),b||(b=f(y));var _,E,C,S=a?n:l(v,b,parseInt("function"==typeof s.offset?s.offset(n,i):s.offset,10),s.clip),O=S-m,A=u(),I=0,D=function(e,r){var o=t.pageYOffset;if(e==r||o==r||(m<r&&t.innerHeight+o)>=A)return T.cancelScroll(!0),d(n,r,a),p("scrollStop",s,n,i),_=null,w=null,!0},k=function(e){_||(_=e),I+=e-_,E=I/parseInt(s.speed,10),E=E>1?1:E,C=m+O*c(s,E),t.scrollTo(0,Math.floor(C)),D(C,S)||(w=t.requestAnimationFrame(k),_=e)};0===t.pageYOffset&&t.scrollTo(0,0),h(n,a,s),p("scrollStart",s,n,i),T.cancelScroll(!0),t.requestAnimationFrame(k)}};var C=function(e){if(!i()&&0===e.button&&!e.metaKey&&!e.ctrlKey&&"closest"in e.target&&(_=e.target.closest(o))&&"a"===_.tagName.toLowerCase()&&!e.target.closest(g.ignore)&&_.hostname===t.location.hostname&&_.pathname===t.location.pathname&&/#/.test(_.href)){var n=a(s(_.hash)),r=g.topOnEmptyHash&&"#"===n?document.documentElement:document.querySelector(n);(r=r||"#top"!==n?r:document.documentElement)&&(e.preventDefault(),T.animateScroll(r,_))}},S=function(t){if(history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(g)&&history.state.anchor){var e=document.querySelector(a(s(history.state.anchor)));e&&T.animateScroll(e,null,{updateURL:!1})}},O=function(t){E||(E=setTimeout(function(){E=null,b=f(y)},66))};return T.destroy=function(){g&&(document.removeEventListener("click",C,!1),t.removeEventListener("resize",O,!1),t.removeEventListener("popstate",S,!1),T.cancelScroll(),g=null,m=null,_=null,y=null,b=null,E=null,w=null)},T.init=function(i){if(!n())throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";T.destroy(),g=r(e,i||{}),y=g.header?document.querySelector(g.header):null,b=f(y),document.addEventListener("click",C,!1),y&&t.addEventListener("resize",O,!1),g.updateURL&&g.popstate&&t.addEventListener("popstate",S,!1)},T.init(v),T}})}).call(e,n(4))},function(t,e,n){function r(t){return n(i(t))}function i(t){var e=o[t];if(!(e+1))throw new Error("Cannot find module '"+t+"'.");return e}var o={"./icon-cfpb.png":29,"./icon-lender.png":30,"./logo.png":31};r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=28},function(t,e){t.exports="../img/icon-cfpb.png"},function(t,e){t.exports="../img/icon-lender.png"},function(t,e){t.exports="../img/logo.png"},function(t,e){function n(t){throw new Error("Cannot find module '"+t+"'.")}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=32}]);
//# sourceMappingURL=app.js.map