Skip to content

Instantly share code, notes, and snippets.

@hugochinchilla
Last active February 24, 2017 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugochinchilla/8cfc47946ad9f13035a6228064aece2c to your computer and use it in GitHub Desktop.
Save hugochinchilla/8cfc47946ad9f13035a6228064aece2c to your computer and use it in GitHub Desktop.
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.jumpsuit=t(require("React"),require("ReactDOM")):e.jumpsuit=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=125)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,u],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.createPath=t.parsePath=t.getQueryStringValueFromPath=t.stripQueryStringValueFromPath=t.addQueryStringValueToPath=void 0;var o=n(4),i=(r(o),t.addQueryStringValueToPath=function(e,t,n){var r=a(e),o=r.pathname,i=r.search,s=r.hash;return u({pathname:o,search:i+(i.indexOf("?")===-1?"?":"&")+t+"="+n,hash:s})},t.stripQueryStringValueFromPath=function(e,t){var n=a(e),r=n.pathname,o=n.search,i=n.hash;return u({pathname:r,search:o.replace(new RegExp("([?&])"+t+"=[a-zA-Z0-9]+(&?)"),function(e,t,n){return"?"===t?t:n}),hash:i})},t.getQueryStringValueFromPath=function(e,t){var n=a(e),r=n.search,o=r.match(new RegExp("[?&]"+t+"=([a-zA-Z0-9]+)"));return o&&o[1]},function(e){var t=e.match(/^(https?:)?\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}),a=t.parsePath=function(e){var t=i(e),n="",r="",o=t.indexOf("#");o!==-1&&(r=t.substring(o),t=t.substring(0,o));var a=t.indexOf("?");return a!==-1&&(n=t.substring(a),t=t.substring(0,a)),""===t&&(t="/"),{pathname:t,search:n,hash:r}},u=t.createPath=function(e){if(null==e||"string"==typeof e)return e;var t=e.basename,n=e.pathname,r=e.search,o=e.hash,i=(t||"")+n;return r&&"?"!==r&&(i+=r),o&&(i+=o),i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return null==e||d.default.isValidElement(e)}function i(e){return o(e)||Array.isArray(e)&&e.every(o)}function a(e,t){return f({},e,t)}function u(e){var t=e.type,n=a(t.defaultProps,e.props);if(n.children){var r=s(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function s(e,t){var n=[];return d.default.Children.forEach(e,function(e){if(d.default.isValidElement(e))if(e.type.createRouteFromReactElement){var r=e.type.createRouteFromReactElement(e,t);r&&n.push(r)}else n.push(u(e))}),n}function c(e){return i(e)?e=s(e):e&&!Array.isArray(e)&&(e=[e]),e}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.isReactChildren=i,t.createRouteFromReactElement=u,t.createRoutesFromReactChildren=s,t.createRoutes=c;var l=n(0),d=r(l)},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.locationsAreEqual=t.statesAreEqual=t.createLocation=t.createQuery=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),u=r(a),s=n(4),c=(r(s),n(2)),f=n(11),l=(t.createQuery=function(e){return i(Object.create(null),e)},t.createLocation=function(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?f.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r="string"==typeof e?(0,c.parsePath)(e):e,o=r.pathname||"/",i=r.search||"",a=r.hash||"",u=r.state;return{pathname:o,search:i,hash:a,state:u,action:t,key:n}},function(e){return"[object Date]"===Object.prototype.toString.call(e)}),d=t.statesAreEqual=function e(t,n){if(t===n)return!0;var r="undefined"==typeof t?"undefined":o(t),i="undefined"==typeof n?"undefined":o(n);if(r!==i)return!1;if("function"===r?(0,u.default)(!1):void 0,"object"===r){if(l(t)&&l(n)?(0,u.default)(!1):void 0,!Array.isArray(t)){var a=Object.keys(t),s=Object.keys(n);return a.length===s.length&&a.every(function(r){return e(t[r],n[r])})}return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])})}return!1};t.locationsAreEqual=function(e,t){return e.key===t.key&&e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&d(e.state,t.state)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(e){for(var t="",n=[],r=[],i=void 0,a=0,u=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;i=u.exec(e);)i.index!==a&&(r.push(e.slice(a,i.index)),t+=o(e.slice(a,i.index))),i[1]?(t+="([^/]+)",n.push(i[1])):"**"===i[0]?(t+="(.*)",n.push("splat")):"*"===i[0]?(t+="(.*?)",n.push("splat")):"("===i[0]?t+="(?:":")"===i[0]&&(t+=")?"),r.push(i[0]),a=u.lastIndex;return a!==e.length&&(r.push(e.slice(a,e.length)),t+=o(e.slice(a,e.length))),{pattern:e,regexpSource:t,paramNames:n,tokens:r}}function a(e){return p[e]||(p[e]=i(e)),p[e]}function u(e,t){"/"!==e.charAt(0)&&(e="/"+e);var n=a(e),r=n.regexpSource,o=n.paramNames,i=n.tokens;"/"!==e.charAt(e.length-1)&&(r+="/?"),"*"===i[i.length-1]&&(r+="$");var u=t.match(new RegExp("^"+r,"i"));if(null==u)return null;var s=u[0],c=t.substr(s.length);if(c){if("/"!==s.charAt(s.length-1))return null;c="/"+c}return{remainingPathname:c,paramNames:o,paramValues:u.slice(1).map(function(e){return e&&decodeURIComponent(e)})}}function s(e){return a(e).paramNames}function c(e,t){var n=u(e,t);if(!n)return null;var r=n.paramNames,o=n.paramValues,i={};return r.forEach(function(e,t){i[e]=o[t]}),i}function f(e,t){t=t||{};for(var n=a(e),r=n.tokens,o=0,i="",u=0,s=[],c=void 0,f=void 0,l=void 0,p=0,h=r.length;p<h;++p)if(c=r[p],"*"===c||"**"===c)l=Array.isArray(t.splat)?t.splat[u++]:t.splat,null!=l||o>0?void 0:(0,d.default)(!1),null!=l&&(i+=encodeURI(l));else if("("===c)s[o]="",o+=1;else if(")"===c){var v=s.pop();o-=1,o?s[o-1]+=v:i+=v}else if(":"===c.charAt(0))if(f=c.substring(1),l=t[f],null!=l||o>0?void 0:(0,d.default)(!1),null==l){if(o){s[o-1]="";for(var y=r.indexOf(c),m=r.slice(y,r.length),g=-1,_=0;_<m.length;_++)if(")"==m[_]){g=_;break}g>0?void 0:(0,d.default)(!1),p=y+g-1}}else o?s[o-1]+=encodeURIComponent(l):i+=encodeURIComponent(l);else o?s[o-1]+=c:i+=c;return o<=0?void 0:(0,d.default)(!1),i.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=a,t.matchPattern=u,t.getParamNames=s,t.getParams=c,t.formatPattern=f;var l=n(1),d=r(l),p=Object.create(null)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(t.indexOf("deprecated")!==-1){if(s[t])return;s[t]=!0}t="[react-router] "+t;for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];u.default.apply(void 0,[e,t].concat(r))}function i(){s={}}t.__esModule=!0,t.default=o,t._resetWarned=i;var a=n(4),u=r(a),s={}},function(e,t,n){"use strict";function r(e,t,n){if(e[t])return new Error("<"+n+'> should not have a "'+t+'" prop')}t.__esModule=!0,t.routes=t.route=t.components=t.component=t.history=void 0,t.falsy=r;var o=n(0),i=o.PropTypes.func,a=o.PropTypes.object,u=o.PropTypes.arrayOf,s=o.PropTypes.oneOfType,c=o.PropTypes.element,f=o.PropTypes.shape,l=o.PropTypes.string,d=(t.history=f({listen:i.isRequired,push:i.isRequired,replace:i.isRequired,go:i.isRequired,goBack:i.isRequired,goForward:i.isRequired}),t.component=s([i,l])),p=(t.components=s([d,a]),t.route=s([a,c]));t.routes=s([p,u(p)])},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=o.middleware,l=void 0===f?[]:f,d=o.enhancers,p=void 0===d?[]:d,h=o.history,v=void 0===h?(0,s.GetHistory)():h,y=i.applyMiddleware.apply(void 0,[(0,a.routerMiddleware)(v)].concat(r(l),[(0,u.CreateJumpstateMiddleware)()])),m=[y].concat(r(p)),g=i.compose,_=g.apply(void 0,r(m));return t.store=c=(0,i.createStore)(e,n,_),c}Object.defineProperty(t,"__esModule",{value:!0}),t.devToolsConfig=t.store=void 0,t.default=o;var i=n(27),a=n(22),u=n(15),s=n(14),c=t.store=void 0;t.devToolsConfig={}},function(e,t,n){"use strict";t.__esModule=!0;t.PUSH="PUSH",t.REPLACE="REPLACE",t.POP="POP"},function(e,t,n){"use strict";t.__esModule=!0;t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.supportsHistory=function(){var e=window.navigator.userAgent;return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},t.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},t.supportsPopstateOnHashchange=function(){return window.navigator.userAgent.indexOf("Trident")===-1}},function(e,t,n){"use strict";function r(e){return function(e){return u===a&&(u=e.dispatch,s=e.getState),function(e){return function(t){var n=e(t);return o.EffectRegistry[t.type]&&o.EffectRegistry[t.type](t),i.HookRegistry.forEach(function(e){return e(t)}),n}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.getState=t.dispatch=void 0,t.default=r;var o=n(36),i=n(37),a=function(){console.warn("It looks like you're trying to use Jumpstate without the middleware! For Jumpstate to work, you need to run CreateJumpstateMiddleware() and apply it as middleware to your Redux Store.")},u=a,s=a;t.dispatch=function(){return u.apply(void 0,arguments)},t.getState=function(){return s.apply(void 0,arguments)}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.GetHistory=void 0;var r=n(16),o=["browser","hash","memory"],i="browser";t.default=function(e){if(e){if(o.indexOf(e)===-1)throw new Error('"'+e+'" is not a valid browser mode! Must be one of: '+JSON.stringify(o));i=e}return i};t.GetHistory=function(){return e.IS_SERVERSIDE||"memory"===i?(0,r.createMemoryHistory)():"browser"===i?r.browserHistory:"hash"===i?r.hashHistory:void 0}}).call(t,n(5))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.dispatch=t.getState=t.CreateJumpstateMiddleware=t.ActionCreators=t.Actions=t.Hook=t.Effect=t.State=void 0;var o=n(75),i=r(o),a=n(36),u=r(a),s=n(37),c=r(s),f=n(21),l=n(13),d=r(l);t.State=i.default,t.Effect=u.default,t.Hook=c.default,t.Actions=f.Actions,t.ActionCreators=f.ActionCreators,t.CreateJumpstateMiddleware=d.default,t.getState=l.getState,t.dispatch=l.dispatch},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.createMemoryHistory=t.hashHistory=t.browserHistory=t.applyRouterMiddleware=t.formatPattern=t.useRouterHistory=t.match=t.routerShape=t.locationShape=t.RouterContext=t.createRoutes=t.Route=t.Redirect=t.IndexRoute=t.IndexRedirect=t.withRouter=t.IndexLink=t.Link=t.Router=void 0;var o=n(3);Object.defineProperty(t,"createRoutes",{enumerable:!0,get:function(){return o.createRoutes}});var i=n(25);Object.defineProperty(t,"locationShape",{enumerable:!0,get:function(){return i.locationShape}}),Object.defineProperty(t,"routerShape",{enumerable:!0,get:function(){return i.routerShape}});var a=n(7);Object.defineProperty(t,"formatPattern",{enumerable:!0,get:function(){return a.formatPattern}});var u=n(101),s=r(u),c=n(47),f=r(c),l=n(97),d=r(l),p=n(112),h=r(p),v=n(98),y=r(v),m=n(99),g=r(m),_=n(49),b=r(_),w=n(100),E=r(w),S=n(26),O=r(S),x=n(110),A=r(x),j=n(54),k=r(j),R=n(103),P=r(R),T=n(104),C=r(T),q=n(108),L=r(q),M=n(51),I=r(M);t.Router=s.default,t.Link=f.default,t.IndexLink=d.default,t.withRouter=h.default,t.IndexRedirect=y.default,t.IndexRoute=g.default,t.Redirect=b.default,t.Route=E.default,t.RouterContext=O.default,t.match=A.default,t.useRouterHistory=k.default,t.applyRouterMiddleware=P.default,t.browserHistory=C.default,t.hashHistory=L.default,t.createMemoryHistory=I.default},function(e,t,n){"use strict";t.__esModule=!0,t.go=t.replaceLocation=t.pushLocation=t.startListener=t.getUserConfirmation=t.getCurrentLocation=void 0;var r=n(6),o=n(12),i=n(31),a=n(2),u=n(18),s="popstate",c="hashchange",f=u.canUseDOM&&!(0,o.supportsPopstateOnHashchange)(),l=function(e){var t=e&&e.key;return(0,r.createLocation)({pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,state:t?(0,i.readState)(t):void 0},void 0,t)},d=t.getCurrentLocation=function(){var e=void 0;try{e=window.history.state||{}}catch(t){e={}}return l(e)},p=(t.getUserConfirmation=function(e,t){return t(window.confirm(e))},t.startListener=function(e){var t=function(t){void 0!==t.state&&e(l(t.state))};(0,o.addEventListener)(window,s,t);var n=function(){return e(d())};return f&&(0,o.addEventListener)(window,c,n),function(){(0,o.removeEventListener)(window,s,t),f&&(0,o.removeEventListener)(window,c,n)}},function(e,t){var n=e.state,r=e.key;void 0!==n&&(0,i.saveState)(r,n),t({key:r},(0,a.createPath)(e))});t.pushLocation=function(e){return p(e,function(e,t){return window.history.pushState(e,null,t)})},t.replaceLocation=function(e){return p(e,function(e,t){return window.history.replaceState(e,null,t)})},t.go=function(e){e&&window.history.go(e)}},function(e,t,n){"use strict";t.__esModule=!0;t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(68),i=n(2),a=n(20),u=r(a),s=n(11),c=n(6),f=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.getCurrentLocation,n=e.getUserConfirmation,r=e.pushLocation,a=e.replaceLocation,f=e.go,l=e.keyLength,d=void 0,p=void 0,h=[],v=[],y=[],m=function(){return p&&p.action===s.POP?y.indexOf(p.key):d?y.indexOf(d.key):-1},g=function(e){var t=m();d=e,d.action===s.PUSH?y=[].concat(y.slice(0,t+1),[d.key]):d.action===s.REPLACE&&(y[t]=d.key),v.forEach(function(e){return e(d)})},_=function(e){return h.push(e),function(){return h=h.filter(function(t){return t!==e})}},b=function(e){return v.push(e),function(){return v=v.filter(function(t){return t!==e})}},w=function(e,t){(0,o.loopAsync)(h.length,function(t,n,r){(0,u.default)(h[t],e,function(e){return null!=e?r(e):n()})},function(e){n&&"string"==typeof e?n(e,function(e){return t(e!==!1)}):t(e!==!1)})},E=function(e){d&&(0,c.locationsAreEqual)(d,e)||p&&(0,c.locationsAreEqual)(p,e)||(p=e,w(e,function(t){if(p===e)if(p=null,t){if(e.action===s.PUSH){var n=(0,i.createPath)(d),o=(0,i.createPath)(e);o===n&&(0,c.statesAreEqual)(d.state,e.state)&&(e.action=s.REPLACE)}e.action===s.POP?g(e):e.action===s.PUSH?r(e)!==!1&&g(e):e.action===s.REPLACE&&a(e)!==!1&&g(e)}else if(d&&e.action===s.POP){var u=y.indexOf(d.key),l=y.indexOf(e.key);u!==-1&&l!==-1&&f(u-l)}}))},S=function(e){return E(R(e,s.PUSH))},O=function(e){return E(R(e,s.REPLACE))},x=function(){return f(-1)},A=function(){return f(1)},j=function(){return Math.random().toString(36).substr(2,l||6)},k=function(e){return(0,i.createPath)(e)},R=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?j():arguments[2];return(0,c.createLocation)(e,t,n)};return{getCurrentLocation:t,listenBefore:_,listen:b,transitionTo:E,push:S,replace:O,go:f,goBack:x,goForward:A,createKey:j,createPath:i.createPath,createHref:k,createLocation:R}};t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(4),i=(r(o),function(e,t,n){var r=e(t,n);e.length<2&&n(r)});t.default=i},function(e,t,n){"use strict";function r(e,t,n,r){if(r){if("function"==typeof s[r])throw new Error('An action called "'+r+'" already exists! Please pick another sandbox name!');if(s[r]=s[r]||{},c[r]=c[r]||{},s[r][e])throw new Error('An action called "'+e+'" in the '+r+" sandbox already exists! Please pick another action name!");return s[r][e]=function(e){return t(e)},void(c[r][e]=n)}if("object"===u(s[e]))throw new Error('An action called "'+e+'" in the '+r+" sandbox already exists! Please pick another action name!");return!!s[e]||(s[e]=function(e){return t(e)},void(c[e]=n))}function o(e,t,n){if(s[e])throw new Error('An action called "'+e+'" already exists! Please pick another name for this effect!');s[e]=function(e){return t(e)},c[e]=n}function i(e,t){return t?(delete s[t][e],void delete c[t][e]):(delete s[e],void delete c[e])}function a(){for(var e in s)s.hasOwnProperty(e)&&(delete s[e],delete c[e])}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.addAction=r,t.addEffect=o,t.removeAction=i,t.reset=a;var s=t.Actions={},c=t.ActionCreators={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.routerMiddleware=t.routerActions=t.goForward=t.goBack=t.go=t.replace=t.push=t.CALL_HISTORY_METHOD=t.routerReducer=t.LOCATION_CHANGE=t.syncHistoryWithStore=void 0;var o=n(46);Object.defineProperty(t,"LOCATION_CHANGE",{enumerable:!0,get:function(){return o.LOCATION_CHANGE}}),Object.defineProperty(t,"routerReducer",{enumerable:!0,get:function(){return o.routerReducer}});var i=n(45);Object.defineProperty(t,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return i.CALL_HISTORY_METHOD}}),Object.defineProperty(t,"push",{enumerable:!0,get:function(){return i.push}}),Object.defineProperty(t,"replace",{enumerable:!0,get:function(){return i.replace}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return i.go}}),Object.defineProperty(t,"goBack",{enumerable:!0,get:function(){return i.goBack}}),Object.defineProperty(t,"goForward",{enumerable:!0,get:function(){return i.goForward}}),Object.defineProperty(t,"routerActions",{enumerable:!0,get:function(){return i.routerActions}});var a=n(96),u=r(a),s=n(95),c=r(s);t.syncHistoryWithStore=u.default,t.routerMiddleware=c.default},function(e,t,n){"use strict";function r(e,t,n){function r(){return a=!0,u?void(c=[].concat(Array.prototype.slice.call(arguments))):void n.apply(this,arguments)}function o(){if(!a&&(s=!0,!u)){for(u=!0;!a&&i<e&&s;)s=!1,t.call(this,i++,o,r);return u=!1,a?void n.apply(this,c):void(i>=e&&s&&(a=!0,n()))}}var i=0,a=!1,u=!1,s=!1,c=void 0;o()}function o(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(i[e]=r,a=++u===o,a&&n(null,i)))}var o=e.length,i=[];if(0===o)return n(null,i);var a=!1,u=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0,t.loopAsync=r,t.mapAsync=o},function(e,t,n){"use strict";function r(e){return"@@contextSubscriber/"+e}function o(e){var t,n,o=r(e),i=o+"/listeners",a=o+"/eventIndex",s=o+"/subscribe";return n={childContextTypes:(t={},t[o]=u.isRequired,t),getChildContext:function(){var e;return e={},e[o]={eventIndex:this[a],subscribe:this[s]},e},componentWillMount:function(){this[i]=[],this[a]=0},componentWillReceiveProps:function(){this[a]++},componentDidUpdate:function(){var e=this;this[i].forEach(function(t){return t(e[a])})}},n[s]=function(e){var t=this;return this[i].push(e),function(){t[i]=t[i].filter(function(t){return t!==e})}},n}function i(e){var t,n,o=r(e),i=o+"/lastRenderedEventIndex",a=o+"/handleContextUpdate",s=o+"/unsubscribe";return n={contextTypes:(t={},t[o]=u,t),getInitialState:function(){var e;return this.context[o]?(e={},e[i]=this.context[o].eventIndex,e):{}},componentDidMount:function(){this.context[o]&&(this[s]=this.context[o].subscribe(this[a]))},componentWillReceiveProps:function(){var e;this.context[o]&&this.setState((e={},e[i]=this.context[o].eventIndex,e))},componentWillUnmount:function(){this[s]&&(this[s](),this[s]=null)}},n[a]=function(e){if(e!==this.state[i]){var t;this.setState((t={},t[i]=e,t))}},n}t.__esModule=!0,t.ContextProvider=o,t.ContextSubscriber=i;var a=n(0),u=a.PropTypes.shape({subscribe:a.PropTypes.func.isRequired,eventIndex:a.PropTypes.number.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.locationShape=t.routerShape=void 0;var r=n(0),o=r.PropTypes.func,i=r.PropTypes.object,a=r.PropTypes.shape,u=r.PropTypes.string;t.routerShape=a({push:o.isRequired,replace:o.isRequired,go:o.isRequired,goBack:o.isRequired,goForward:o.isRequired,setRouteLeaveHook:o.isRequired,isActive:o.isRequired}),t.locationShape=a({pathname:u.isRequired,search:u.isRequired,state:i,action:u.isRequired,key:u})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(1),u=r(a),s=n(0),c=r(s),f=n(107),l=r(f),d=n(24),p=n(3),h=c.default.PropTypes,v=h.array,y=h.func,m=h.object,g=c.default.createClass({displayName:"RouterContext",mixins:[(0,d.ContextProvider)("router")],propTypes:{router:m.isRequired,location:m.isRequired,routes:v.isRequired,params:m.isRequired,components:v.isRequired,createElement:y.isRequired},getDefaultProps:function(){return{createElement:c.default.createElement}},childContextTypes:{router:m.isRequired},getChildContext:function(){return{router:this.props.router}},createElement:function(e,t){return null==e?null:this.props.createElement(e,t)},render:function(){var e=this,t=this.props,n=t.location,r=t.routes,a=t.params,s=t.components,f=t.router,d=null;return s&&(d=s.reduceRight(function(t,u,s){if(null==u)return t;var c=r[s],d=(0,l.default)(c,a),h={location:n,params:a,route:c,router:f,routeParams:d,routes:r};if((0,p.isReactChildren)(t))h.children=t;else if(t)for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(h[v]=t[v]);if("object"===("undefined"==typeof u?"undefined":i(u))){var y={};for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(y[m]=e.createElement(u[m],o({key:m},h)));return y}return e.createElement(u,h)},d)),null===d||d===!1||c.default.isValidElement(d)?void 0:(0,u.default)(!1),d}});t.default=g,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(56),o=n(115),i=n(114),a=n(113),u=n(55);n(57);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return o.a}),n.d(t,"bindActionCreators",function(){return i.a}),n.d(t,"applyMiddleware",function(){return a.a}),n.d(t,"compose",function(){return u.a})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(27),i=n(22);t.default=function(e){return(0,o.combineReducers)(r({},e,{routing:i.routerReducer}))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t){if("object"===("undefined"==typeof e?"undefined":o(e))&&!e.dispatch){var n=(0,c.default)(e);e=(0,l.default)(n)}var r=function(){return a.default.createElement("div",{id:"jumpsuit-root"},t)};return function(){return a.default.createElement(u.Provider,{store:e},a.default.createElement(r,null))}};var i=n(0),a=r(i),u=n(42),s=n(28),c=r(s),f=n(10),l=r(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getSyncedHistory=void 0;var o=n(0),i=r(o),a=n(22),u=n(16),s=n(14),c=n(10),f=void 0;t.getSyncedHistory=function(){return f};t.default=i.default.createClass({displayName:"router",render:function(){var e=this.props,t=e.history,n=e.syncedHistory,r=void 0;return r=t?t:(0,s.GetHistory)(),f=n||(0,a.syncHistoryWithStore)(r,c.store),i.default.createElement(u.Router,{history:f},this.props.children)}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.readState=t.saveState=void 0;var o=n(4),i=(r(o),{QuotaExceededError:!0,QUOTA_EXCEEDED_ERR:!0}),a={SecurityError:!0},u="@@History/",s=function(e){return u+e};t.saveState=function(e,t){if(window.sessionStorage)try{null==t?window.sessionStorage.removeItem(s(e)):window.sessionStorage.setItem(s(e),JSON.stringify(t))}catch(e){if(a[e.name])return;if(i[e.name]&&0===window.sessionStorage.length)return;throw e}},t.readState=function(e){var t=void 0;try{t=window.sessionStorage.getItem(s(e))}catch(e){if(a[e.name])return}if(t)try{return JSON.parse(t)}catch(e){}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(20),a=r(i),u=n(2),s=function(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e(t),r=t.basename,i=function(e){return e?(r&&null==e.basename&&(0===e.pathname.indexOf(r)?(e.pathname=e.pathname.substring(r.length),e.basename=r,""===e.pathname&&(e.pathname="/")):e.basename=""),e):e},s=function(e){if(!r)return e;var t="string"==typeof e?(0,u.parsePath)(e):e,n=t.pathname,i="/"===r.slice(-1)?r:r+"/",a="/"===n.charAt(0)?n.slice(1):n,s=i+a;return o({},t,{pathname:s})},c=function(){return i(n.getCurrentLocation())},f=function(e){return n.listenBefore(function(t,n){return(0,a.default)(e,i(t),n)})},l=function(e){return n.listen(function(t){return e(i(t))})},d=function(e){return n.push(s(e))},p=function(e){return n.replace(s(e))},h=function(e){return n.createPath(s(e))},v=function(e){return n.createHref(s(e))},y=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return i(n.createLocation.apply(n,[s(e)].concat(r)))};return o({},n,{getCurrentLocation:c,listenBefore:f,listen:l,push:d,replace:p,createPath:h,createHref:v,createLocation:y})}};t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(41),a=n(20),u=r(a),s=n(6),c=n(2),f=function(e){return(0,i.stringify)(e).replace(/%20/g,"+")},l=i.parse,d=function(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e(t),r=t.stringifyQuery,i=t.parseQueryString;"function"!=typeof r&&(r=f),"function"!=typeof i&&(i=l);var a=function(e){return e?(null==e.query&&(e.query=i(e.search.substring(1))),e):e},d=function(e,t){if(null==t)return e;var n="string"==typeof e?(0,c.parsePath)(e):e,i=r(t),a=i?"?"+i:"";return o({},n,{search:a})},p=function(){return a(n.getCurrentLocation())},h=function(e){return n.listenBefore(function(t,n){return(0,u.default)(e,a(t),n)})},v=function(e){return n.listen(function(t){return e(a(t))})},y=function(e){return n.push(d(e,e.query))},m=function(e){return n.replace(d(e,e.query))},g=function(e){return n.createPath(d(e,e.query))},_=function(e){return n.createHref(d(e,e.query))},b=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var i=n.createLocation.apply(n,[d(e,e.query)].concat(r));return e.query&&(i.query=(0,s.createQuery)(e.query)),a(i)};return o({},n,{getCurrentLocation:p,listenBefore:h,listen:v,push:y,replace:m,createPath:g,createHref:_,createLocation:b})}};t.default=d},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},i="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,n){if("string"!=typeof t){var a=Object.getOwnPropertyNames(t);i&&(a=a.concat(Object.getOwnPropertySymbols(t)));for(var u=0;u<a.length;++u)if(!(r[a[u]]||o[a[u]]||n&&n[a[u]]))try{e[a[u]]=t[a[u]]}catch(e){}}return e}},function(e,t,n){"use strict";(function(t){function n(){f=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}f=!1}function r(e){1!==l.push(e)||f||o()}var o,i=t.MutationObserver||t.WebKitMutationObserver;if(i){var a=0,u=new i(n),s=t.document.createTextNode("");u.observe(s,{characterData:!0}),o=function(){s.data=a=++a%2}}else if(t.setImmediate||"undefined"==typeof t.MessageChannel)o="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){n(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(n,0)};else{var c=new t.MessageChannel;c.port1.onmessage=n,o=function(){c.port2.postMessage(0)}}var f,l=[];e.exports=r}).call(t,n(5))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EffectRegistry=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t){if("string"!=typeof e)throw new Error('Named effects require a valid string as the name eg. Effect("myAction", () => {...})');var n=function(e){var n=e.payload,r=e._jumpstateTimestamp,i=t(n,o.getState,o.dispatch);r&&Promise.resolve(i).then(u[r].resolve).catch(u[r].reject)};a[e]=n;var s=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r({},n);return delete o.type,delete o.payload,r({type:e,payload:t},o)},c=function(e){var t=Date.now();return new Promise(function(n,r){u[t]={resolve:n,reject:r},(0,o.dispatch)(s(e,{_jumpstateTimestamp:t}))})};return c.actionCreator=s,(0,i.addEffect)(e,c,s),c.cancel=function(){delete a[e],(0,i.removeAction)(e)},c};var o=n(13),i=n(21),a=t.EffectRegistry={},u={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HookRegistry=void 0,t.default=function(e){var t=function(t){e(t,r.getState,r.dispatch)};o.push(t);var n=function(){t()};return n.cancel=function(){o.splice(o.indexOf(t),1)},n};var r=n(13),o=t.HookRegistry=[]},function(e,t,n){"use strict";var r=n(83),o=r.a.Symbol;t.a=o},function(e,t,n){"use strict";function r(e){if(!n.i(a.a)(e)||n.i(o.a)(e)!=u)return!1;var t=n.i(i.a)(e);if(null===t)return!0;var r=l.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&f.call(r)==d}var o=n(77),i=n(79),a=n(84),u="[object Object]",s=Function.prototype,c=Object.prototype,f=s.toString,l=c.hasOwnProperty,d=f.call(Object);t.a=r},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined");
}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){v&&p&&(v=!1,p.length?h=p.concat(h):y=-1,h.length&&u())}function u(){if(!v){var e=o(a);v=!0;for(var t=h.length;t;){for(p=h,h=[];++y<t;)p&&p[y].run();y=-1,t=h.length}p=null,v=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function c(){}var f,l,d=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var p,h=[],v=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new s(e,t)),1!==h.length||v||o(u)},s.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=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){"use strict";function r(e,t){return t.encode?t.strict?o(e):encodeURIComponent(e):e}var o=n(118),i=n(89);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){var t=Object.create(null);return"string"!=typeof e?t:(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var n=e.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]}),t):t},t.stringify=function(e,t){var n={encode:!0,strict:!0};return t=i(n,t),e?Object.keys(e).sort().map(function(n){var o=e[n];if(void 0===o)return"";if(null===o)return r(n,t);if(Array.isArray(o)){var i=[];return o.slice().forEach(function(e){void 0!==e&&(null===e?i.push(r(n,t)):i.push(r(n,t)+"="+r(e,t)))}),i.join("&")}return r(n,t)+"="+r(o,t)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.connect=t.Provider=void 0;var o=n(91),i=r(o),a=n(92),u=r(a);t.Provider=i.default,t.connect=u.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=r.PropTypes.shape({subscribe:r.PropTypes.func.isRequired,dispatch:r.PropTypes.func.isRequired,getState:r.PropTypes.func.isRequired})},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return{type:o,payload:{method:e,args:n}}}}Object.defineProperty(t,"__esModule",{value:!0});var o=t.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD",i=t.push=r("push"),a=t.replace=r("replace"),u=t.go=r("go"),s=t.goBack=r("goBack"),c=t.goForward=r("goForward");t.routerActions={push:i,replace:a,go:u,goBack:s,goForward:c}},function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=t.payload;return n===i?o({},e,{locationBeforeTransitions:r}):e}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.routerReducer=r;var i=t.LOCATION_CHANGE="@@router/LOCATION_CHANGE",a={locationBeforeTransitions:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){return 0===e.button}function a(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function u(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function s(e,t){return"function"==typeof e?e(t.location):e}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=n(0),l=r(f),d=n(1),p=r(d),h=n(25),v=n(24),y=l.default.PropTypes,m=y.bool,g=y.object,_=y.string,b=y.func,w=y.oneOfType,E=l.default.createClass({displayName:"Link",mixins:[(0,v.ContextSubscriber)("router")],contextTypes:{router:h.routerShape},propTypes:{to:w([_,g,b]),query:g,hash:_,state:g,activeStyle:g,activeClassName:_,onlyActiveOnIndex:m.isRequired,onClick:b,target:_},getDefaultProps:function(){return{onlyActiveOnIndex:!1,style:{}}},handleClick:function(e){if(this.props.onClick&&this.props.onClick(e),!e.defaultPrevented){var t=this.context.router;t?void 0:(0,p.default)(!1),!a(e)&&i(e)&&(this.props.target||(e.preventDefault(),t.push(s(this.props.to,t))))}},render:function(){var e=this.props,t=e.to,n=e.activeClassName,r=e.activeStyle,i=e.onlyActiveOnIndex,a=o(e,["to","activeClassName","activeStyle","onlyActiveOnIndex"]),f=this.context.router;if(f){if(null==t)return l.default.createElement("a",a);var d=s(t,f);a.href=f.createHref(d),(n||null!=r&&!u(r))&&f.isActive(d,i)&&(n&&(a.className?a.className+=" "+n:a.className=n),r&&(a.style=c({},a.style,r)))}return l.default.createElement("a",c({},a,{onClick:this.handleClick}))}});t.default=E,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&"function"==typeof e.then}t.__esModule=!0,t.isPromise=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(0),i=r(o),a=n(1),u=r(a),s=n(3),c=n(7),f=n(9),l=i.default.PropTypes,d=l.string,p=l.object,h=i.default.createClass({displayName:"Redirect",statics:{createRouteFromReactElement:function(e){var t=(0,s.createRouteFromReactElement)(e);return t.from&&(t.path=t.from),t.onEnter=function(e,n){var r=e.location,o=e.params,i=void 0;if("/"===t.to.charAt(0))i=(0,c.formatPattern)(t.to,o);else if(t.to){var a=e.routes.indexOf(t),u=h.getRoutePattern(e.routes,a-1),s=u.replace(/\/*$/,"/")+t.to;i=(0,c.formatPattern)(s,o)}else i=r.pathname;n({pathname:i,query:t.query||r.query,state:t.state||r.state})},t},getRoutePattern:function(e,t){for(var n="",r=t;r>=0;r--){var o=e[r],i=o.path||"";if(n=i.replace(/\/*$/,"/")+n,0===i.indexOf("/"))break}return"/"+n}},propTypes:{path:d,from:d,to:d.isRequired,query:p,state:p,onEnter:f.falsy,children:f.falsy},render:function(){(0,u.default)(!1)}});t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){var r=i({},e,{setRouteLeaveHook:t.listenBeforeLeavingRoute,isActive:t.isActive});return o(r,n)}function o(e,t){var n=t.location,r=t.params,o=t.routes;return e.location=n,e.params=r,e.routes=o,e}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.createRouterObject=r,t.assignRouterState=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(0,f.default)(e),n=function(){return t},r=(0,a.default)((0,s.default)(n))(e);return r}t.__esModule=!0,t.default=o;var i=n(33),a=r(i),u=n(32),s=r(u),c=n(73),f=r(c);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=void 0;return a&&(t=(0,i.default)(e)()),t};var o=n(54),i=r(o),a=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function i(e,t){function n(t,n){return t=e.createLocation(t),(0,d.default)(t,n,_.location,_.routes,_.params)}function r(e,n){b&&b.location===e?i(b,n):(0,y.default)(t,e,function(t,r){t?n(t):r?i(a({},r,{location:e}),n):n()})}function i(e,t){function n(n,o){return n||o?r(n,o):void(0,h.default)(e,function(n,r){n?t(n):t(null,null,_=a({},e,{components:r}))})}function r(e,n){e?t(e):t(null,n)}var o=(0,c.default)(_,e),i=o.leaveRoutes,u=o.changeRoutes,s=o.enterRoutes;(0,f.runLeaveHooks)(i,_),i.filter(function(e){return s.indexOf(e)===-1}).forEach(v),(0,f.runChangeHooks)(u,_,e,function(t,o){return t||o?r(t,o):void(0,f.runEnterHooks)(s,e,n)})}function u(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.__id__||t&&(e.__id__=w++)}function s(e){return e.map(function(e){return E[u(e)]}).filter(function(e){return e})}function l(e,n){(0,y.default)(t,e,function(t,r){if(null==r)return void n();b=a({},r,{location:e});for(var o=s((0,c.default)(_,b).leaveRoutes),i=void 0,u=0,f=o.length;null==i&&u<f;++u)i=o[u](e);n(i)})}function p(){if(_.routes){for(var e=s(_.routes),t=void 0,n=0,r=e.length;"string"!=typeof t&&n<r;++n)t=e[n]();return t}}function v(e){var t=u(e);t&&(delete E[t],o(E)||(S&&(S(),S=null),O&&(O(),O=null)))}function m(t,n){var r=!o(E),i=u(t,!0);return E[i]=n,r&&(S=e.listenBefore(l),e.listenBeforeUnload&&(O=e.listenBeforeUnload(p))),function(){v(t)}}function g(t){function n(n){_.location===n?t(null,_):r(n,function(n,r,o){n?t(n):r?e.replace(r):o&&t(null,o)})}var o=e.listen(n);return _.location?t(null,_):n(e.getCurrentLocation()),o}var _={},b=void 0,w=1,E=Object.create(null),S=void 0,O=void 0;return{isActive:n,match:r,listenBeforeLeavingRoute:m,listen:g}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=i;var u=n(8),s=(r(u),n(105)),c=r(s),f=n(102),l=n(109),d=r(l),p=n(106),h=r(p),v=n(111),y=r(v);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(t){var n=(0,a.default)((0,s.default)(e))(t);return n}}t.__esModule=!0,t.default=o;var i=n(33),a=r(i),u=n(32),s=r(u);e.exports=t.default},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};if(1===t.length)return t[0];var r=t[t.length-1],o=t.slice(0,-1);return function(){return o.reduceRight(function(e,t){return t(e)},r.apply(void 0,arguments))}}t.a=r},function(e,t,n){"use strict";function r(e,t,i){function s(){g===m&&(g=m.slice())}function c(){return y}function f(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return s(),g.push(e),function(){if(t){t=!1,s();var n=g.indexOf(e);g.splice(n,1)}}}function l(e){if(!n.i(o.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(_)throw new Error("Reducers may not dispatch actions.");try{_=!0,y=v(y,e)}finally{_=!1}for(var t=m=g,r=0;r<t.length;r++)t[r]();return e}function d(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");v=e,l({type:u.INIT})}function p(){var e,t=f;return e={subscribe:function(e){function n(){e.next&&e.next(c())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");n();var r=t(n);return{unsubscribe:r}}},e[a.a]=function(){return this},e}var h;if("function"==typeof t&&"undefined"==typeof i&&(i=t,t=void 0),"undefined"!=typeof i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var v=e,y=t,m=[],g=m,_=!1;return l({type:u.INIT}),h={dispatch:l,subscribe:f,getState:c,replaceReducer:d},h[a.a]=p,h}var o=n(39),i=n(119),a=n.n(i);n.d(t,"b",function(){return u}),t.a=r;var u={INIT:"@@redux/INIT"}},function(e,t,n){"use strict"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42),o=n(64);t.default=function(e,t){return t?(0,r.connect)(t)((0,o.component)(e)):(0,o.component)(e)}},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=(0,i.getState)(),a=(0,o.getSyncedHistory)(),u=r.routing.locationBeforeTransitions,s=n?a.replace:a.push;if("string"==typeof e)return a.push(e);var c=e.path,f=e.query,l=e.hash,d=l?"#"+l:void 0;if(!t)return s({pathname:c||u.pathname,query:f,hash:d});var p=Object.assign({},u.query,f);for(var h in p)void 0!==p[h]&&null!==p[h]||delete p[h];var v={pathname:c||u.pathname,query:p,hash:d||u.hash};return s(v)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=n(30),i=n(15);r.back=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return(0,o.getSyncedHistory)().go(-Math.abs(e))},r.forward=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,o.getSyncedHistory)().go(Math.abs(e))}},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Rerender=t.hsrAPI=void 0;var o=n(0),i=r(o),a=n(41),u=r(a),s=n(63),c=r(s),f=n(10),l=function(e){var t=f.store.liftedStore;t.dispatch({type:"IMPORT_STATE",nextLiftedState:e,noRecompute:!0})},d=function(){var e=f.store.liftedStore;return e.getState()},p=e,h=p.location,v=p.history,y=t.hsrAPI=c.default;t.Rerender=function(){var e=Date.now(),t=d();return console.info("Saving state..."),Promise.resolve(y.save(e,t)).then(function(t){console.info("Saved state.");var n=u.default.parse(h.search);n.hsr=e,h.search=u.default.stringify(n)}).catch(function(e){return console.error(e)})};t.default=i.default.createClass({displayName:"hsr",getInitialState:function(){return{ready:!1}},componentWillMount:function(){var e=this,t=u.default.parse(h.search);if(t.hsr){var n=t.hsr;delete t.hsr;var r=u.default.stringify(t),o=h.href.substring(0,h.href.indexOf("?"))+(r.length?"?"+r:"");v.replaceState(null,null,o),console.info("Restoring state..."),Promise.resolve(y.restore(n)).then(function(e){l(e),console.info("Restored state.")}).catch(function(e){console.error(e)}).then(function(t){e.setState({ready:!0})})}else this.setState({ready:!0})},render:function(){return this.state.ready?this.props.children:i.default.createElement("span",null)}})}).call(t,n(5))},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(){var t="object"===o(arguments.length<=0?void 0:arguments[0])&&"object"===o(arguments.length<=1?void 0:arguments[1]),n=t&&(arguments.length<=0?void 0:arguments[0]),r=t?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],i=t?(0,c.default)(n,r):function(){return r};return e.document&&(0,u.render)(a.default.createElement(i,null),e.document.getElementById((t?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1])||"root")),i};var i=n(0),a=r(i),u=n(124),s=n(29),c=r(s)}).call(t,n(5))},function(e,t,n){"use strict";function r(e){return function(){var t=arguments.length;if(t){for(var n=[],r=-1;++r<t;)n[r]=arguments[r];return e.call(this,n)}return e.call(this,[])}}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return c.put({_id:String(e),state:JSON.stringify(t)})}function i(e){return c.get(e).then(function(e){return a(),JSON.parse(e.state)})}function a(){return c.allDocs().then(function(e){if(e.rows.length<20)return Promise.resolve(c);console.info("Cleaning HSR Pouch history...");var t=e.rows.map(function(e){return{id:e.id,rev:e.value.rev,_deleted:!0}});return c.bulkDocs(t)}).then(function(e){return c.compact()}).then(function(){return console.info("Cleaned."),c})}Object.defineProperty(t,"__esModule",{value:!0});var u=n(90),s=r(u),c=new s.default("jumpsuit_hsr");t.default={save:o,restore:i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.component=void 0;var o=n(0),i=r(o);t.component=function(e){return"function"==typeof e&&e.prototype.isReactComponent?e:i.default.createClass(e)}},function(e,t,n){(function(r){function o(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,r)}}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function s(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof r&&"env"in r)return n.i({NODE_ENV:"production"}).DEBUG}function c(){try{return window.localStorage}catch(e){}}t=e.exports=n(66),t.log=a,t.formatArgs=i,t.save=u,t.load=s,t.useColors=o,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(s())}).call(t,n(40))},function(e,t,n){function r(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}function o(e){function n(){if(n.enabled){var e=n,r=+new Date,o=r-(c||r);e.diff=o,e.prev=c,e.curr=r,c=r;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=t.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var u=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;u++;var o=t.formatters[r];if("function"==typeof o){var a=i[u];n=o.call(e,a),i.splice(u,1),u--}return n}),t.formatArgs.call(e,i);var s=n.log||t.log||console.log.bind(console);s.apply(e,i)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=r(e),"function"==typeof t.init&&t.init(n),n}function i(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&(e=n[o].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function a(){t.enable("")}function u(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1}function s(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o.debug=o.default=o,t.coerce=s,t.disable=a,t.enable=i,t.enabled=u,t.humanize=n(88),t.names=[],t.skips=[],t.formatters={};var c},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,o,u,s,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(n=this._events[e],a(n))return!1;if(r(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:u=Array.prototype.slice.call(arguments,1),n.apply(this,u)}else if(i(n))for(u=Array.prototype.slice.call(arguments,1),c=n.slice(),o=c.length,s=0;s<o;s++)c[s].apply(this,u);return!0},n.prototype.addListener=function(e,t){var o;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(o=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,a,u;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(u=a;u-- >0;)if(n[u]===t||n[u].listener&&n[u].listener===t){o=u;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";t.__esModule=!0;t.loopAsync=function(e,t,n){var r=0,o=!1,i=!1,a=!1,u=void 0,s=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return o=!0,i?void(u=t):void n.apply(void 0,t)},c=function c(){if(!o&&(a=!0,!i)){for(i=!0;!o&&r<e&&a;)a=!1,t(r++,c,s);return i=!1,o?void n.apply(void 0,u):void(r>=e&&a&&(o=!0,n()))}};c()}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.replaceLocation=t.pushLocation=t.startListener=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var o=n(17);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return o.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}});var i=n(4),a=(r(i),n(6)),u=n(12),s=n(31),c=n(2),f="hashchange",l=function(){var e=window.location.href,t=e.indexOf("#");return t===-1?"":e.substring(t+1)},d=function(e){return window.location.hash=e},p=function(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)},h=t.getCurrentLocation=function(e,t){var n=e.decodePath(l()),r=(0,c.getQueryStringValueFromPath)(n,t),o=void 0;r&&(n=(0,c.stripQueryStringValueFromPath)(n,t),o=(0,s.readState)(r));var i=(0,c.parsePath)(n);return i.state=o,(0,a.createLocation)(i,void 0,r)},v=void 0,y=(t.startListener=function(e,t,n){var r=function(){var r=l(),o=t.encodePath(r);if(r!==o)p(o);else{var i=h(t,n);if(v&&i.key&&v.key===i.key)return;v=i,e(i)}},o=l(),i=t.encodePath(o);return o!==i&&p(i),(0,u.addEventListener)(window,f,r),function(){return(0,u.removeEventListener)(window,f,r)}},function(e,t,n,r){var o=e.state,i=e.key,a=t.encodePath((0,c.createPath)(e));void 0!==o&&(a=(0,c.addQueryStringValueToPath)(a,n,i),(0,s.saveState)(i,o)),v=e,r(a)});t.pushLocation=function(e,t,n){return y(e,t,n,function(e){l()!==e&&d(e)})},t.replaceLocation=function(e,t,n){return y(e,t,n,function(e){l()!==e&&p(e)})}},function(e,t,n){"use strict";t.__esModule=!0,t.replaceLocation=t.pushLocation=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var r=n(17);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return r.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return r.go}});var o=n(6),i=n(2);t.getCurrentLocation=function(){return(0,o.createLocation)(window.location)},t.pushLocation=function(e){return window.location.href=(0,i.createPath)(e),!1},t.replaceLocation=function(e){return window.location.replace((0,i.createPath)(e)),!1}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),u=o(a),s=n(18),c=n(17),f=r(c),l=n(70),d=r(l),p=n(12),h=n(19),v=o(h),y=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];s.canUseDOM?void 0:(0,u.default)(!1);var t=e.forceRefresh||!(0,p.supportsHistory)(),n=t?d:f,r=n.getUserConfirmation,o=n.getCurrentLocation,a=n.pushLocation,c=n.replaceLocation,l=n.go,h=(0,v.default)(i({getUserConfirmation:r},e,{getCurrentLocation:o,pushLocation:a,replaceLocation:c,go:l})),y=0,m=void 0,g=function(e,t){1===++y&&(m=f.startListener(h.transitionTo));var n=t?h.listenBefore(e):h.listen(e);return function(){n(),0===--y&&m()}},_=function(e){return g(e,!0)},b=function(e){return g(e,!1)};return i({},h,{listenBefore:_,listen:b})};t.default=y},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(4),u=(o(a),n(1)),s=o(u),c=n(18),f=n(12),l=n(69),d=r(l),p=n(19),h=o(p),v="_k",y=function(e){return"/"===e.charAt(0)?e:"/"+e},m={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!"+e},decodePath:function(e){return"!"===e.charAt(0)?e.substring(1):e}},noslash:{encodePath:function(e){return"/"===e.charAt(0)?e.substring(1):e},decodePath:y},slash:{encodePath:y,decodePath:y}},g=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:(0,s.default)(!1);var t=e.queryKey,n=e.hashType;"string"!=typeof t&&(t=v),null==n&&(n="slash"),n in m||(n="slash");var r=m[n],o=d.getUserConfirmation,a=function(){return d.getCurrentLocation(r,t)},u=function(e){return d.pushLocation(e,r,t)},l=function(e){return d.replaceLocation(e,r,t)},p=(0,h.default)(i({getUserConfirmation:o},e,{getCurrentLocation:a,pushLocation:u,replaceLocation:l,go:d.go})),y=0,g=void 0,_=function(e,n){1===++y&&(g=d.startListener(p.transitionTo,r,t));var o=n?p.listenBefore(e):p.listen(e);return function(){o(),0===--y&&g()}},b=function(e){return _(e,!0)},w=function(e){return _(e,!1)},E=((0,f.supportsGoWithoutReloadUsingHash)(),function(e){p.go(e)}),S=function(e){return"#"+r.encodePath(p.createHref(e))};return i({},p,{listenBefore:b,listen:w,go:E,createHref:S})};t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(4),a=(r(i),n(1)),u=r(a),s=n(6),c=n(2),f=n(19),l=r(f),d=n(11),p=function(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})},h=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(e)?e={entries:e}:"string"==typeof e&&(e={entries:[e]});var t=function(){var e=v[y],t=(0,c.createPath)(e),n=void 0,r=void 0;e.key&&(n=e.key,r=_(n));var i=(0,c.parsePath)(t);return(0,s.createLocation)(o({},i,{state:r}),void 0,n)},n=function(e){var t=y+e;return t>=0&&t<v.length},r=function(e){if(e&&n(e)){y+=e;var r=t();f.transitionTo(o({},r,{action:d.POP}))}},i=function(e){y+=1,y<v.length&&v.splice(y),v.push(e),g(e.key,e.state)},a=function(e){v[y]=e,g(e.key,e.state)},f=(0,l.default)(o({},e,{getCurrentLocation:t,pushLocation:i,replaceLocation:a,go:r})),h=e,v=h.entries,y=h.current;"string"==typeof v?v=[v]:Array.isArray(v)||(v=["/"]),v=v.map(function(e){return(0,s.createLocation)(e)}),null==y?y=v.length-1:y>=0&&y<v.length?void 0:(0,u.default)(!1);var m=p(v),g=function(e,t){return m[e]=t},_=function(e){return m[e]};return o({},f,{canGo:n})};t.default=h},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(){var e=arguments.length>1,t=e?arguments.length<=0?void 0:arguments[0]:void 0,n=e?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0];if(e&&("string"!=typeof t||!t.length))throw new Error("Sandboxed states names must be a valid string");var a=n.initial;delete n.initial;var u={},s=void 0,c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s=u[t.type]?u[t.type](e,t.payload):e||a};return c.getState=function(){return s},c.actionCreators={},Object.keys(n).forEach(function(e){var a=t?t+"_"+e:e;u[a]=n[e];var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r({},t);return delete n.type,delete n.payload,r({type:a,payload:e},n)};c.actionCreators[e]=s;var f=function(e){var t=s(e);return(0,o.dispatch)(t)};c[e]=f,(0,i.addAction)(e,f,s,t)}),c};var o=n(13),i=n(21)}).call(t,n(40))},function(e,t,n){"use strict";function r(){}function o(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=g,this.queue=[],this.outcome=void 0,e!==r&&s(this,e)}function i(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),
"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function a(e,t,n){h(function(){var r;try{r=t(n)}catch(t){return v.reject(e,t)}r===e?v.reject(e,new TypeError("Cannot resolve promise with itself")):v.resolve(e,r)})}function u(e){var t=e&&e.then;if(e&&"object"==typeof e&&"function"==typeof t)return function(){t.apply(e,arguments)}}function s(e,t){function n(t){i||(i=!0,v.reject(e,t))}function r(t){i||(i=!0,v.resolve(e,t))}function o(){t(r,n)}var i=!1,a=c(o);"error"===a.status&&n(a.value)}function c(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function f(e){return e instanceof this?e:v.resolve(new this(r),e)}function l(e){var t=new this(r);return v.reject(t,e)}function d(e){function t(e,t){function r(e){a[t]=e,++u!==o||i||(i=!0,v.resolve(c,a))}n.resolve(e).then(r,function(e){i||(i=!0,v.reject(c,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var o=e.length,i=!1;if(!o)return this.resolve([]);for(var a=new Array(o),u=0,s=-1,c=new this(r);++s<o;)t(e[s],s);return c}function p(e){function t(e){n.resolve(e).then(function(e){i||(i=!0,v.resolve(u,e))},function(e){i||(i=!0,v.reject(u,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var o=e.length,i=!1;if(!o)return this.resolve([]);for(var a=-1,u=new this(r);++a<o;)t(e[a]);return u}var h=n(35),v={},y=["REJECTED"],m=["FULFILLED"],g=["PENDING"];e.exports=o,o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){if("function"!=typeof e&&this.state===m||"function"!=typeof t&&this.state===y)return this;var n=new this.constructor(r);if(this.state!==g){var o=this.state===m?e:t;a(n,o,this.outcome)}else this.queue.push(new i(n,e,t));return n},i.prototype.callFulfilled=function(e){v.resolve(this.promise,e)},i.prototype.otherCallFulfilled=function(e){a(this.promise,this.onFulfilled,e)},i.prototype.callRejected=function(e){v.reject(this.promise,e)},i.prototype.otherCallRejected=function(e){a(this.promise,this.onRejected,e)},v.resolve=function(e,t){var n=c(u,t);if("error"===n.status)return v.reject(e,n.value);var r=n.value;if(r)s(e,r);else{e.state=m,e.outcome=t;for(var o=-1,i=e.queue.length;++o<i;)e.queue[o].callFulfilled(t)}return e},v.reject=function(e,t){e.state=y,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},o.resolve=f,o.reject=l,o.all=d,o.race=p},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?s:u:(e=Object(e),c&&c in e?n.i(i.a)(e):n.i(a.a)(e))}var o=n(38),i=n(80),a=n(81),u="[object Null]",s="[object Undefined]",c=o.a?o.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(5))},function(e,t,n){"use strict";var r=n(82),o=n.i(r.a)(Object.getPrototypeOf,Object);t.a=o},function(e,t,n){"use strict";function r(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[s]=n:delete e[s]),o}var o=n(38),i=Object.prototype,a=i.hasOwnProperty,u=i.toString,s=o.a?o.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return i.call(e)}var o=Object.prototype,i=o.toString;t.a=r},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict";var r=n(78),o="object"==typeof self&&self&&self.Object===Object&&self,i=r.a||o||Function("return this")();t.a=i},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t,n){function r(e){if(!i(e)||f.call(e)!=a||o(e))return!1;var t=l(e);if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==c}var o=n(85),i=n(86),a="[object Object]",u=Object.prototype,s=Function.prototype.toString,c=s.call(Object),f=u.toString,l=Object.getPrototypeOf;e.exports=r},function(e,t){function n(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;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 r(e){return e>=c?Math.round(e/c)+"d":e>=s?Math.round(e/s)+"h":e>=u?Math.round(e/u)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function o(e){return i(e,c,"day")||i(e,s,"hour")||i(e,u,"minute")||i(e,a,"second")||e+" ms"}function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var a=1e3,u=60*a,s=60*u,c=24*s,f=365.25*c;e.exports=function(e,t){t=t||{};var i=typeof e;if("string"===i&&e.length>0)return n(e);if("number"===i&&isNaN(e)===!1)return t.long?o(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(e,t){for(var n,o,u=r(e),s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var c in n)i.call(n,c)&&(u[c]=n[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(n);for(var f=0;f<o.length;f++)a.call(n,o[f])&&(u[o[f]]=n[o[f]])}}return u}},function(e,t,n){"use strict";(function(t){function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function o(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}function i(e){if("function"==typeof e.slice)return e.slice(0);var t=new ArrayBuffer(e.byteLength),n=new Uint8Array(t),r=new Uint8Array(e);return n.set(r),t}function a(e){if(e instanceof ArrayBuffer)return i(e);var t=e.size,n=e.type;return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n)}function u(e){var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&no.call(n)==ro}function s(e){var t,n,r;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,r=e.length;n<r;n++)t[n]=s(e[n]);return t}if(e instanceof Date)return e.toISOString();if(o(e))return a(e);if(!u(e))return e;t={};for(n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=s(e[n]);"undefined"!=typeof i&&(t[n]=i)}return t}function c(e){var t=!1;return Vr(function(n){if(t)throw new Error("once called more than once");t=!0,e.apply(this,n)})}function f(e){return Vr(function(t){t=s(t);var n=this,r="function"==typeof t[t.length-1]&&t.pop(),o=new to(function(r,o){var i;try{var a=c(function(e,t){e?o(e):r(t)});t.push(a),i=e.apply(n,t),i&&"function"==typeof i.then&&r(i)}catch(e){o(e)}});return r&&o.then(function(e){r(null,e)},r),o})}function l(e,t){function n(e,t,n){if(oo.enabled){for(var r=[e.name,t],o=0;o<n.length-1;o++)r.push(n[o]);oo.apply(null,r);var i=n[n.length-1];n[n.length-1]=function(n,r){var o=[e.name,t];o=o.concat(n?["error",n]:["success",r]),oo.apply(null,o),i(n,r)}}}return f(Vr(function(r){if(this._closed)return to.reject(new Error("database is closed"));if(this._destroyed)return to.reject(new Error("database is destroyed"));var o=this;return n(o,e,r),this.taskqueue.isReady?t.apply(this,r):new to(function(t,n){o.taskqueue.addTask(function(i){i?n(i):t(o[e].apply(o,r))})})}))}function d(e,t){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];i in e&&(n[i]=e[i])}return n}function p(e){return"$"+e}function h(e){return e.substring(1)}function v(){this._store={}}function y(e){if(this._store=new v,e&&Array.isArray(e))for(var t=0,n=e.length;t<n;t++)this.add(e[t])}function m(){if("undefined"==typeof Symbol||"undefined"==typeof Map||"undefined"==typeof Set)return!1;var e=Object.getOwnPropertyDescriptor(Map,Symbol.species);return e&&"get"in e&&Map[Symbol.species]===Map}function g(e){return e}function _(e){return[{ok:e}]}function b(e,t,n){function r(){var e=[];p.forEach(function(t){t.docs.forEach(function(n){e.push({id:t.id,docs:[n]})})}),n(null,{results:e})}function o(){++l===f&&r()}function i(e,t,n){p[e]={id:t,docs:n},o()}function a(){if(!(v>=h.length)){var e=Math.min(v+so,h.length),t=h.slice(v,e);u(t,v),v+=t.length}}function u(n,r){n.forEach(function(n,o){var u=r+o,s=c.get(n),f=d(s[0],["atts_since","attachments"]);f.open_revs=s.map(function(e){return e.rev}),f.open_revs=f.open_revs.filter(g);var l=g;0===f.open_revs.length&&(delete f.open_revs,l=_),["revs","attachments","binary","ajax","latest"].forEach(function(e){e in t&&(f[e]=t[e])}),e.get(n,f,function(e,t){var r;r=e?[{error:e}]:l(t),i(u,n,r),a()})})}var s=t.docs,c=new ao;s.forEach(function(e){c.has(e.id)?c.get(e.id).push(e):c.set(e.id,[e])});var f=c.size,l=0,p=new Array(f),h=[];c.forEach(function(e,t){h.push(t)});var v=0;a()}function w(){return"undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage&&"undefined"!=typeof chrome.storage.local}function E(){return uo}function S(e){w()?chrome.storage.onChanged.addListener(function(t){null!=t.db_name&&e.emit(t.dbName.newValue)}):E()&&("undefined"!=typeof addEventListener?addEventListener("storage",function(t){e.emit(t.key)}):window.attachEvent("storage",function(t){e.emit(t.key)}))}function O(){Qr.EventEmitter.call(this),this._listeners={},S(this)}function x(e){if("undefined"!==console&&e in console){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}function A(e,t){var n=6e5;e=parseInt(e,10)||0,t=parseInt(t,10),t!==t||t<=e?t=(e||1)<<1:t+=1,t>n&&(e=n>>1,t=n);var r=Math.random(),o=t-e;return~~(o*r+e)}function j(e){var t=0;return e||(t=2e3),A(e,t)}function k(e,t){x("info","The above "+e+" is totally normal. "+t)}function R(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}function P(e,t){function n(t){for(var n in e)"function"!=typeof e[n]&&(this[n]=e[n]);void 0!==t&&(this.reason=t)}return n.prototype=R.prototype,new n(t)}function T(e){if("object"!=typeof e){var t=e;e=_o,e.data=t}return"error"in e&&"conflict"===e.error&&(e.name="conflict",e.status=409),"name"in e||(e.name=e.error||"unknown"),"status"in e||(e.status=500),"message"in e||(e.message=e.message||e.reason),e}function C(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return P(So,r)}}function q(e){var t={},n=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(r){r.doc||(r.doc={});var o=n&&C(e.filter,r.doc,t);if("object"==typeof o)return o;if(o)return!1;if(e.include_docs){if(!e.attachments)for(var i in r.doc._attachments)r.doc._attachments.hasOwnProperty(i)&&(r.doc._attachments[i].stub=!0)}else delete r.doc;return!0}}function L(e){for(var t=[],n=0,r=e.length;n<r;n++)t=t.concat(e[n]);return t}function M(){}function I(e){var t;if(e?"string"!=typeof e?t=P(yo):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=P(go)):t=P(mo),t)throw t}function D(e,t){return"listenerCount"in e?e.listenerCount(t):Qr.EventEmitter.listenerCount(e,t)}function N(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function B(e){var t=N(e);return t?t.join("/"):null}function U(e){for(var t=qo.exec(e),n={},r=14;r--;){var o=Po[r],i=t[r]||"",a=["user","password"].indexOf(o)!==-1;n[o]=a?decodeURIComponent(i):i}return n[To]={},n[Po[12]].replace(Co,function(e,t,r){t&&(n[To][t]=r)}),n}function F(e,t,n){return new to(function(r,o){e.get(t,function(i,a){if(i){if(404!==i.status)return o(i);a={}}var u=a._rev,s=n(a);return s?(s._id=t,s._rev=u,void r(H(e,s,n))):r({updated:!1,rev:u})})})}function H(e,t,n){return e.put(t).then(function(e){return{updated:!0,rev:e.rev}},function(r){if(409!==r.status)throw r;return F(e,t._id,n)})}function W(e){return 0|Math.random()*e}function J(e,t){t=t||Lo.length;var n="",r=-1;if(e){for(;++r<e;)n+=Lo[W(t)];return n}for(;++r<36;)switch(r){case 8:case 13:case 18:case 23:n+="-";break;case 19:n+=Lo[3&W(16)|8];break;default:n+=Lo[W(16)]}return n}function G(e){for(var t,n,r,o,i=e.rev_tree.slice();o=i.pop();){var a=o.ids,u=a[2],s=o.pos;if(u.length)for(var c=0,f=u.length;c<f;c++)i.push({pos:s+1,ids:u[c]});else{var l=!!a[1].deleted,d=a[0];t&&!(r!==l?r:n!==s?n<s:t<d)||(t=d,n=s,r=l)}}return n+"-"+t}function K(e,t){for(var n,r=e.slice();n=r.pop();)for(var o=n.pos,i=n.ids,a=i[2],u=t(0===a.length,o,i[0],n.ctx,i[1]),s=0,c=a.length;s<c;s++)r.push({pos:o+1,ids:a[s],ctx:u})}function V(e,t){return e.pos-t.pos}function z(e){var t=[];K(e,function(e,n,r,o,i){e&&t.push({rev:n+"-"+r,pos:n,opts:i})}),t.sort(V).reverse();for(var n=0,r=t.length;n<r;n++)delete t[n].pos;return t}function Q(e){for(var t=G(e),n=z(e.rev_tree),r=[],o=0,i=n.length;o<i;o++){var a=n[o];a.rev===t||a.opts.deleted||r.push(a.rev)}return r}function X(e){var t=[];return K(e.rev_tree,function(e,n,r,o,i){"available"!==i.status||e||(t.push(n+"-"+r),i.status="missing")}),t}function $(e){for(var t,n=[],r=e.slice();t=r.pop();){var o=t.pos,i=t.ids,a=i[0],u=i[1],s=i[2],c=0===s.length,f=t.history?t.history.slice():[];f.push({id:a,opts:u}),c&&n.push({pos:o+1-f.length,ids:f});for(var l=0,d=s.length;l<d;l++)r.push({pos:o+1,ids:s[l],history:f})}return n.reverse()}function Y(e,t){return e.pos-t.pos}function Z(e,t,n){for(var r,o=0,i=e.length;o<i;)r=o+i>>>1,n(e[r],t)<0?o=r+1:i=r;return o}function ee(e,t,n){var r=Z(e,t,n);e.splice(r,0,t)}function te(e,t){for(var n,r,o=t,i=e.length;o<i;o++){var a=e[o],u=[a.id,a.opts,[]];r?(r[2].push(u),r=u):n=r=u}return n}function ne(e,t){return e[0]<t[0]?-1:1}function re(e,t){for(var n=[{tree1:e,tree2:t}],r=!1;n.length>0;){var o=n.pop(),i=o.tree1,a=o.tree2;(i[1].status||a[1].status)&&(i[1].status="available"===i[1].status||"available"===a[1].status?"available":"missing");for(var u=0;u<a[2].length;u++)if(i[2][0]){for(var s=!1,c=0;c<i[2].length;c++)i[2][c][0]===a[2][u][0]&&(n.push({tree1:i[2][c],tree2:a[2][u]}),s=!0);s||(r="new_branch",ee(i[2],a[2][u],ne))}else r="new_leaf",i[2][0]=a[2][u]}return{conflicts:r,tree:e}}function oe(e,t,n){var r,o=[],i=!1,a=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var u=0,s=e.length;u<s;u++){var c=e[u];if(c.pos===t.pos&&c.ids[0]===t.ids[0])r=re(c.ids,t.ids),o.push({pos:c.pos,ids:r.tree}),i=i||r.conflicts,a=!0;else if(n!==!0){var f=c.pos<t.pos?c:t,l=c.pos<t.pos?t:c,d=l.pos-f.pos,p=[],h=[];for(h.push({ids:f.ids,diff:d,parent:null,parentIdx:null});h.length>0;){var v=h.pop();if(0!==v.diff)for(var y=v.ids[2],m=0,g=y.length;m<g;m++)h.push({ids:y[m],diff:v.diff-1,parent:v.ids,parentIdx:m});else v.ids[0]===l.ids[0]&&p.push(v)}var _=p[0];_?(r=re(_.ids,l.ids),_.parent[2][_.parentIdx]=r.tree,o.push({pos:f.pos,ids:f.ids}),i=i||r.conflicts,a=!0):o.push(c)}else o.push(c)}return a||o.push(t),o.sort(Y),{tree:o,conflicts:i||"internal_node"}}function ie(e,t){for(var n,r=$(e),o={},i=0,a=r.length;i<a;i++){for(var u=r[i],s=u.ids,c=Math.max(0,s.length-t),f={pos:u.pos+c,ids:te(s,c)},l=0;l<c;l++){var d=u.pos+l+"-"+s[l].id;o[d]=!0}n=n?oe(n,f,!0).tree:[f]}return K(n,function(e,t,n){delete o[t+"-"+n]}),{tree:n,revs:Object.keys(o)}}function ae(e,t,n){var r=oe(e,t),o=ie(r.tree,n);return{tree:o.tree,stemmedRevs:o.revs,conflicts:r.conflicts}}function ue(e,t){for(var n,r=e.slice(),o=t.split("-"),i=parseInt(o[0],10),a=o[1];n=r.pop();){if(n.pos===i&&n.ids[0]===a)return!0;for(var u=n.ids[2],s=0,c=u.length;s<c;s++)r.push({pos:n.pos+1,ids:u[s]})}return!1}function se(e){return e.ids}function ce(e,t){t||(t=G(e));for(var n,r=t.substring(t.indexOf("-")+1),o=e.rev_tree.map(se);n=o.pop();){if(n[0]===r)return!!n[1].deleted;o=o.concat(n[2])}}function fe(e){return/^_local/.test(e)}function le(e,t){for(var n,r=t.rev_tree.slice();n=r.pop();){var o=n.pos,i=n.ids,a=i[0],u=i[1],s=i[2],c=0===s.length,f=n.history?n.history.slice():[];if(f.push({id:a,pos:o,opts:u}),c)for(var l=0,d=f.length;l<d;l++){var p=f[l],h=p.pos+"-"+p.id;if(h===e)return o+"-"+a}for(var v=0,y=s.length;v<y;v++)r.push({pos:o+1,ids:s[v],history:f})}throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}function de(e){return Yr('"use strict";\nreturn '+e+";",{})}function pe(e){var t=["return function(doc) {",' "use strict";'," var emitted = false;"," var emit = function (a, b) {"," emitted = true;"," };"," var view = "+e+";"," view(doc);"," if (emitted) {"," return true;"," }","};"].join("\n");return Yr(t,{})}function he(e,t){try{e.emit("change",t)}catch(e){x("error",'Error in .on("change", function):',e)}}function ve(e,t,n){function r(){o.cancel()}Qr.EventEmitter.call(this);var o=this;this.db=e,t=t?s(t):{};var i=t.complete=c(function(t,n){t?D(o,"error")>0&&o.emit("error",t):o.emit("complete",n),o.removeAllListeners(),e.removeListener("destroyed",r)});n&&(o.on("complete",function(e){n(null,e)}),o.on("error",n)),e.once("destroyed",r),t.onChange=function(e){o.isCancelled||he(o,e)};var a=new to(function(e,n){t.complete=function(t,r){t?n(t):e(r)}});o.once("cancel",function(){e.removeListener("destroyed",r),t.complete(null,{status:"cancelled"})}),this.then=a.then.bind(a),this.catch=a.catch.bind(a),this.then(function(e){i(null,e)},i),e.taskqueue.isReady?o.doChanges(t):e.taskqueue.addTask(function(e){e?t.complete(e):o.isCancelled?o.emit("cancel"):o.doChanges(t)})}function ye(e,t,n){var r=[{rev:e._rev}];"all_docs"===n.style&&(r=z(t.rev_tree).map(function(e){return{rev:e.rev}}));var o={id:t.id,changes:r,doc:e};return ce(t,e._rev)&&(o.deleted=!0),n.conflicts&&(o.doc._conflicts=Q(t),o.doc._conflicts.length||delete o.doc._conflicts),o}function me(e,t){return e<t?-1:e>t?1:0}function ge(e){return function(t,n){t||n[0]&&n[0].error?e(t||n[0]):e(null,n.length?n[0]:n)}}function _e(e){for(var t=0;t<e.length;t++){var n=e[t];if(n._deleted)delete n._attachments;else if(n._attachments)for(var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=d(n._attachments[i],["data","digest","content_type","length","revpos","stub"])}}}function be(e,t){var n=me(e._id,t._id);if(0!==n)return n;var r=e._revisions?e._revisions.start:0,o=t._revisions?t._revisions.start:0;return me(r,o)}function we(e){var t={},n=[];return K(e,function(e,r,o,i){var a=r+"-"+o;return e&&(t[a]=0),void 0!==i&&n.push({from:i,to:a}),a}),n.reverse(),n.forEach(function(e){void 0===t[e.from]?t[e.from]=1+t[e.to]:t[e.from]=Math.min(t[e.from],1+t[e.to])}),t}function Ee(e,t,n){var r="limit"in t?t.keys.slice(t.skip,t.limit+t.skip):t.skip>0?t.keys.slice(t.skip):t.keys;if(t.descending&&r.reverse(),!r.length)return e._allDocs({limit:0},n);var o={offset:t.skip};return to.all(r.map(function(n){var r=fo({key:n,deleted:"ok"},t);return["limit","skip","keys"].forEach(function(e){delete r[e]}),new to(function(t,i){e._allDocs(r,function(e,r){return e?i(e):(o.total_rows=r.total_rows,void t(r.rows[0]||{key:n,error:"not_found"}))})})})).then(function(e){return o.rows=e,o})}function Se(e){var t=e._compactionQueue[0],n=t.opts,r=t.callback;e.get("_local/compaction").catch(function(){return!1}).then(function(t){t&&t.last_seq&&(n.last_seq=t.last_seq),e._compact(n,function(t,n){t?r(t):r(null,n),$r(function(){e._compactionQueue.shift(),e._compactionQueue.length&&Se(e)})})})}function Oe(e){return"_"===e.charAt(0)&&e+"is not a valid attachment name, attachment names cannot start with '_'"}function xe(){Qr.EventEmitter.call(this)}function Ae(){this.isReady=!1,this.failed=!1,this.queue=[]}function je(e,t){var n=e.match(/([a-z\-]*):\/\/(.*)/);if(n)return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=Re.adapters,o=Re.preferredAdapters,i=Re.prefix,a=t.adapter;if(!a)for(var u=0;u<o.length;++u){a=o[u];{if(!("idb"===a&&"websql"in r&&E()&&localStorage["_pouch__websqldb_"+i+e]))break;x("log",'PouchDB is downgrading "'+e+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.')}}var s=r[a],c=!(s&&"use_prefix"in s)||s.use_prefix;return{name:c?i+e:e,adapter:a}}function ke(e){function t(){e.removeListener("closed",r),e.constructor.emit("destroyed",e.name)}function n(){e.removeListener("destroyed",t),e.removeListener("closed",r),e.emit("destroyed")}function r(){e.removeListener("destroyed",t),o.delete(e.name)}var o=e.constructor._destructionListeners;e.once("destroyed",t),e.once("closed",r),o.has(e.name)||o.set(e.name,[]),o.get(e.name).push(n)}function Re(e,t){if(!(this instanceof Re))return new Re(e,t);var n=this;if(t=t||{},e&&"object"==typeof e&&(t=e,e=t.name,delete t.name),this.__opts=t=s(t),n.auto_compaction=t.auto_compaction,n.prefix=Re.prefix,"string"!=typeof e)throw new Error("Missing/invalid DB name");var r=(t.prefix||"")+e,o=je(r,t);if(t.name=o.name,t.adapter=t.adapter||o.adapter,n.name=e,n._adapter=t.adapter,zr("pouchdb:adapter")("Picked adapter: "+t.adapter),!Re.adapters[t.adapter]||!Re.adapters[t.adapter].valid())throw new Error("Invalid Adapter: "+t.adapter);xe.call(n),n.taskqueue=new Ae,n.adapter=t.adapter,Re.adapters[t.adapter].call(n,t,function(e){return e?n.taskqueue.fail(e):(ke(n),n.emit("created",n),Re.emit("created",n.name),void n.taskqueue.ready(n))})}function Pe(e){Object.keys(Qr.EventEmitter.prototype).forEach(function(t){"function"==typeof Qr.EventEmitter.prototype[t]&&(e[t]=Mo[t].bind(Mo))});var t=e._destructionListeners=new ao;e.on("destroyed",function(e){t.get(e).forEach(function(e){e()}),t.delete(e)})}function Te(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}function Ce(e){if(!/^\d+\-./.test(e))return P(jo);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}function qe(e,t){for(var n=e.start-e.ids.length+1,r=e.ids,o=[r[0],t,[]],i=1,a=r.length;i<a;i++)o=[r[i],{status:"missing"},[o]];return[{pos:n,ids:o}]}function Le(e,t){var n,r,o,i={status:"available"};if(e._deleted&&(i.deleted=!0),t)if(e._id||(e._id=J()),r=J(32,16).toLowerCase(),e._rev){if(o=Ce(e._rev),o.error)return o;e._rev_tree=[{pos:o.prefix,ids:[o.id,{status:"missing"},[[r,i,[]]]]}],n=o.prefix+1}else e._rev_tree=[{pos:1,ids:[r,i,[]]}],n=1;else if(e._revisions&&(e._rev_tree=qe(e._revisions,i),n=e._revisions.start,r=e._revisions.ids[0]),!e._rev_tree){if(o=Ce(e._rev),o.error)return o;n=o.prefix,r=o.id,e._rev_tree=[{pos:n,ids:[r,i,[]]}]}I(e._id),e._rev=n+"-"+r;var a={metadata:{},data:{}};for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var s="_"===u[0];if(s&&!No[u]){var c=P(Eo,u);throw c.message=Eo.message+": "+u,c}s&&!Bo[u]?a.metadata[u.slice(1)]=e[u]:a.data[u]=e[u]}return a}function Me(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,r=new n,o=0;o<e.length;o+=1)r.append(e[o]);return r.getBlob(t.type)}}function Ie(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}function De(e,t){return Me([Ie(e)],{type:t})}function Ne(e,t){return De(Uo(e),t)}function Be(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t+=String.fromCharCode(n[o]);return t}function Ue(e,t){if("undefined"==typeof FileReader)return t(Be((new FileReaderSync).readAsArrayBuffer(e)));var n=new FileReader,r="function"==typeof n.readAsBinaryString;n.onloadend=function(e){var n=e.target.result||"";return r?t(n):void t(Be(n))},r?n.readAsBinaryString(e):n.readAsArrayBuffer(e)}function Fe(e,t){Ue(e,function(e){t(e)})}function He(e,t){Fe(e,function(e){t(Fo(e))})}function We(e,t){if("undefined"==typeof FileReader)return t((new FileReaderSync).readAsArrayBuffer(e));var n=new FileReader;n.onloadend=function(e){var n=e.target.result||new ArrayBuffer(0);t(n)},n.readAsArrayBuffer(e)}function Je(e){return Fo(e)}function Ge(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.slice(t,n)}function Ke(e,t,n,r,o){(n>0||r<t.size)&&(t=Ge(t,n,r)),We(t,function(t){e.append(t),o()})}function Ve(e,t,n,r,o){(n>0||r<t.length)&&(t=t.substring(n,r)),e.appendBinary(t),o()}function ze(e,t){function n(){Ho(o)}function r(){var e=f.end(!0),n=Je(e);t(n),f.destroy()}function o(){var t=c*u,o=t+u;c++,c<s?l(f,e,t,o,n):l(f,e,t,o,r)}var i="string"==typeof e,a=i?e.length:e.size,u=Math.min(Wo,a),s=Math.ceil(a/u),c=0,f=i?new Zr:new Zr.ArrayBuffer,l=i?Ve:Ke;o()}function Qe(e){return Zr.hash(e)}function Xe(e){try{return Uo(e)}catch(e){var t=P(bo,"Attachment is not a valid base64 string");return{error:t}}}function $e(e,t,n){var r=Xe(e.data);return r.error?n(r.error):(e.length=r.length,"blob"===t?e.data=De(r,e.content_type):"base64"===t?e.data=Fo(r):e.data=r,void ze(r,function(t){e.digest="md5-"+t,n()}))}function Ye(e,t,n){ze(e.data,function(r){e.digest="md5-"+r,e.length=e.data.size||e.data.length||0,"binary"===t?Fe(e.data,function(t){e.data=t,n()}):"base64"===t?He(e.data,function(t){e.data=t,n()}):n()})}function Ze(e,t,n){return e.stub?n():void("string"==typeof e.data?$e(e,t,n):Ye(e,t,n))}function et(e,t,n){function r(){i++,e.length===i&&(o?n(o):n())}if(!e.length)return n();var o,i=0;e.forEach(function(e){function n(e){o=e,a++,a===i.length&&r()}var i=e.data&&e.data._attachments?Object.keys(e.data._attachments):[],a=0;if(!i.length)return r();for(var u in e.data._attachments)e.data._attachments.hasOwnProperty(u)&&Ze(e.data._attachments[u],t,n)})}function tt(e,t,n,r,o,i,a,u){if(ue(t.rev_tree,n.metadata.rev))return r[o]=n,i();var s=t.winningRev||G(t),c="deleted"in t?t.deleted:ce(t,s),f="deleted"in n.metadata?n.metadata.deleted:ce(n.metadata),l=/^1-/.test(n.metadata.rev);if(c&&!f&&u&&l){var d=n.data;d._rev=s,d._id=n.metadata.id,n=Le(d,u)}var p=ae(t.rev_tree,n.metadata.rev_tree[0],e),h=u&&(c&&f||!c&&"new_leaf"!==p.conflicts||c&&!f&&"new_branch"===p.conflicts);if(h){var v=P(vo);return r[o]=v,i()}var y=n.metadata.rev;n.metadata.rev_tree=p.tree,n.stemmedRevs=p.stemmedRevs||[],t.rev_map&&(n.metadata.rev_map=t.rev_map);var m,g=G(n.metadata),_=ce(n.metadata,g),b=c===_?0:c<_?-1:1;m=y===g?_:ce(n.metadata,y),a(n,g,_,m,!0,b,o,i)}function nt(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}function rt(e,t,n,r,o,i,a,u,s){function c(e,t,n){var r=G(e.metadata),o=ce(e.metadata,r);if("was_delete"in u&&o)return i[t]=P(ho,"deleted"),n();var s=l&&nt(e);if(s){var c=P(vo);return i[t]=c,n()}var f=o?0:1;a(e,r,o,o,!1,f,t,n)}function f(){++p===h&&s&&s()}e=e||1e3;var l=u.new_edits,d=new ao,p=0,h=t.length;t.forEach(function(e,t){if(e._id&&fe(e._id)){var r=e._deleted?"_removeLocal":"_putLocal";return void n[r](e,{ctx:o},function(e,n){i[t]=e||n,f()})}var a=e.metadata.id;d.has(a)?(h--,d.get(a).push([e,t])):d.set(a,[[e,t]])}),d.forEach(function(t,n){function o(){++s<t.length?u():f()}function u(){var u=t[s],f=u[0],d=u[1];if(r.has(n))tt(e,r.get(n),f,i,d,o,a,l);else{var p=ae([],f.metadata.rev_tree[0],e);f.metadata.rev_tree=p.tree,f.stemmedRevs=p.stemmedRevs||[],c(f,d,o)}}var s=0;u()})}function ot(e){try{return JSON.parse(e)}catch(t){return eo.parse(e)}}function it(e){try{return JSON.stringify(e)}catch(t){return eo.stringify(e)}}function at(e){return function(t){var n="unknown_error";t.target&&t.target.error&&(n=t.target.error.name||t.target.error.message),e(P(xo,n,t.type))}}function ut(e,t,n){return{data:it(e),winningRev:t,deletedOrLocal:n?"1":"0",seq:e.seq,id:e.id}}function st(e){if(!e)return null;var t=ot(e.data);return t.winningRev=e.winningRev,t.deleted="1"===e.deletedOrLocal,t.seq=e.seq,t}function ct(e){if(!e)return e;var t=e._doc_id_rev.lastIndexOf(":");return e._id=e._doc_id_rev.substring(0,t-1),e._rev=e._doc_id_rev.substring(t+1),delete e._doc_id_rev,e}function ft(e,t,n,r){n?r(e?"string"!=typeof e?e:Ne(e,t):Me([""],{type:t})):e?"string"!=typeof e?Ue(e,function(e){r(Fo(e))}):r(e):r("")}function lt(e,t,n,r){function o(){++u===a.length&&r&&r()}function i(e,t){var r=e._attachments[t],i=r.digest,a=n.objectStore(Vo).get(i);a.onsuccess=function(e){r.body=e.target.result.body,o()}}var a=Object.keys(e._attachments||{});if(!a.length)return r&&r();var u=0;a.forEach(function(n){t.attachments&&t.include_docs?i(e,n):(e._attachments[n].stub=!0,o())})}function dt(e,t){return to.all(e.map(function(e){if(e.doc&&e.doc._attachments){var n=Object.keys(e.doc._attachments);return to.all(n.map(function(n){var r=e.doc._attachments[n];if("body"in r){var o=r.body,i=r.content_type;return new to(function(a){ft(o,i,t,function(t){e.doc._attachments[n]=fo(d(r,["digest","content_type"]),{data:t}),a()})})}}))}}))}function pt(e,t,n){function r(){c--,c||o()}function o(){i.length&&i.forEach(function(e){var t=s.index("digestSeq").count(IDBKeyRange.bound(e+"::",e+"::￿",!1,!1));t.onsuccess=function(t){var n=t.target.result;n||u.delete(e)}})}var i=[],a=n.objectStore(Ko),u=n.objectStore(Vo),s=n.objectStore(zo),c=e.length;e.forEach(function(e){var n=a.index("_doc_id_rev"),o=t+"::"+e;n.getKey(o).onsuccess=function(e){var t=e.target.result;if("number"!=typeof t)return r();a.delete(t);var n=s.index("seq").openCursor(IDBKeyRange.only(t));n.onsuccess=function(e){var t=e.target.result;if(t){var n=t.value.digestSeq.split("::")[0];i.push(n),s.delete(t.primaryKey),t.continue()}else r()}}})}function ht(e,t,n){try{return{txn:e.transaction(t,n)}}catch(e){return{error:e}}}function vt(e,t,n,r,o,i){function a(){var e=[Go,Ko,Vo,Xo,zo,Qo],t=ht(o,e,"readwrite");return t.error?i(t.error):(_=t.txn,_.onabort=at(i),_.ontimeout=at(i),_.oncomplete=l,b=_.objectStore(Go),w=_.objectStore(Ko),E=_.objectStore(Vo),S=_.objectStore(zo),O=_.objectStore(Qo),O.get(Qo).onsuccess=function(e){A=e.target.result,c()},void p(function(e){return e?(I=!0,i(e)):void f()}))}function u(){C=!0,c()}function s(){rt(e.revs_limit,j,r,M,_,L,h,n,u)}function c(){A&&C&&(A.docCount+=q,O.put(A))}function f(){function e(){++n===j.length&&s()}function t(t){var n=st(t.target.result);n&&M.set(n.id,n),e()}if(j.length)for(var n=0,r=0,o=j.length;r<o;r++){var i=j[r];if(i._id&&fe(i._id))e();else{var a=b.get(i.metadata.id);a.onsuccess=t}}}function l(){I||(Yo.notify(r._meta.name),i(null,L))}function d(e,t){var n=E.get(e);n.onsuccess=function(n){if(n.target.result)t();else{var r=P(ko,"unknown stub attachment with digest "+e);r.status=412,t(r)}}}function p(e){function t(){++o===n.length&&e(r)}var n=[];if(j.forEach(function(e){e.data&&e.data._attachments&&Object.keys(e.data._attachments).forEach(function(t){var r=e.data._attachments[t];r.stub&&n.push(r.digest)})}),!n.length)return e();var r,o=0;n.forEach(function(e){d(e,function(e){e&&!r&&(r=e),t()})})}function h(e,t,n,r,o,i,a,u){e.metadata.winningRev=t,e.metadata.deleted=n;var s=e.data;s._id=e.metadata.id,s._rev=e.metadata.rev,r&&(s._deleted=!0);var f=s._attachments&&Object.keys(s._attachments).length;return f?y(e,t,n,o,a,u):(q+=i,c(),void v(e,t,n,o,a,u))}function v(e,t,n,o,i,a){function u(i){var a=e.stemmedRevs||[];o&&r.auto_compaction&&(a=a.concat(X(e.metadata))),a&&a.length&&pt(a,e.metadata.id,_),l.seq=i.target.result;var u=ut(l,t,n),s=b.put(u);s.onsuccess=c}function s(e){e.preventDefault(),e.stopPropagation();var t=w.index("_doc_id_rev"),n=t.getKey(f._doc_id_rev);n.onsuccess=function(e){var t=w.put(f,e.target.result);t.onsuccess=u}}function c(){L[i]={ok:!0,id:l.id,rev:l.rev},M.set(e.metadata.id,e.metadata),m(e,l.seq,a)}var f=e.data,l=e.metadata;f._doc_id_rev=l.id+"::"+l.rev,delete f._id,delete f._rev;var d=w.put(f);d.onsuccess=u,d.onerror=s}function y(e,t,n,r,o,i){function a(){c===f.length&&v(e,t,n,r,o,i)}function u(){
c++,a()}var s=e.data,c=0,f=Object.keys(s._attachments);f.forEach(function(n){var r=e.data._attachments[n];if(r.stub)c++,a();else{var o=r.data;delete r.data,r.revpos=parseInt(t,10);var i=r.digest;g(i,o,u)}})}function m(e,t,n){function r(){++i===a.length&&n()}function o(n){var o=e.data._attachments[n].digest,i=S.put({seq:t,digestSeq:o+"::"+t});i.onsuccess=r,i.onerror=function(e){e.preventDefault(),e.stopPropagation(),r()}}var i=0,a=Object.keys(e.data._attachments||{});if(!a.length)return n();for(var u=0;u<a.length;u++)o(a[u])}function g(e,t,n){var r=E.count(e);r.onsuccess=function(r){var o=r.target.result;if(o)return n();var i={digest:e,body:t},a=E.put(i);a.onsuccess=n}}for(var _,b,w,E,S,O,x,A,j=t.docs,k=0,R=j.length;k<R;k++){var T=j[k];T._id&&fe(T._id)||(T=j[k]=Le(T,n.new_edits),T.error&&!x&&(x=T))}if(x)return i(x);var C=!1,q=0,L=new Array(j.length),M=new ao,I=!1,D=r._meta.blobSupport?"blob":"base64";et(j,D,function(e){return e?i(e):void a()})}function yt(e,t,n,r,o){function i(e){f=e.target.result,c&&o(c,f,l)}function a(e){c=e.target.result,f&&o(c,f,l)}function u(){if(!c.length)return o();var n,u=c[c.length-1];if(t&&t.upper)try{n=IDBKeyRange.bound(u,t.upper,!0,t.upperOpen)}catch(e){if("DataError"===e.name&&0===e.code)return o()}else n=IDBKeyRange.lowerBound(u,!0);t=n,c=null,f=null,e.getAll(t,r).onsuccess=i,e.getAllKeys(t,r).onsuccess=a}function s(e){var t=e.target.result;return t?void o([t.key],[t.value],t):o()}var c,f,l,d="function"==typeof e.getAll&&"function"==typeof e.getAllKeys&&r>1&&!n;d?(l={continue:u},e.getAll(t,r).onsuccess=i,e.getAllKeys(t,r).onsuccess=a):n?e.openCursor(t,"prev").onsuccess=s:e.openCursor(t).onsuccess=s}function mt(e,t,n){function r(e){var t=e.target.result;t?(o.push(t.value),t.continue()):n({target:{result:o}})}if("function"==typeof e.getAll)return void(e.getAll(t).onsuccess=n);var o=[];e.openCursor(t).onsuccess=r}function gt(e,t,n,r,o){try{if(e&&t)return o?IDBKeyRange.bound(t,e,!n,!1):IDBKeyRange.bound(e,t,!1,!n);if(e)return o?IDBKeyRange.upperBound(e):IDBKeyRange.lowerBound(e);if(t)return o?IDBKeyRange.lowerBound(t,!n):IDBKeyRange.upperBound(t,!n);if(r)return IDBKeyRange.only(r)}catch(e){return{error:e}}return null}function _t(e,t,n){function r(t,n,r){var o=t.id+"::"+r;x.get(o).onsuccess=function(r){if(n.doc=ct(r.target.result),e.conflicts){var o=Q(t);o.length&&(n.doc._conflicts=o)}lt(n.doc,e,b)}}function o(t,n){var o={id:n.id,key:n.id,value:{rev:t}},i=n.deleted;"ok"===e.deleted?(A.push(o),i?(o.value.deleted=!0,o.doc=null):e.include_docs&&r(n,o,t)):!i&&p--<=0&&(A.push(o),e.include_docs&&r(n,o,t))}function i(e){for(var t=0,n=e.length;t<n&&A.length!==h;t++){var r=e[t],i=st(r),a=i.winningRev;o(a,i)}}function a(e,t,n){n&&(i(t),A.length<h&&n.continue())}function u(t){var n=t.target.result;e.descending&&(n=n.reverse()),i(n)}function s(){n(null,{total_rows:w,offset:e.skip,rows:A})}function c(){e.attachments?dt(A,e.binary).then(s):s()}var f="startkey"in e&&e.startkey,l="endkey"in e&&e.endkey,d="key"in e&&e.key,p=e.skip||0,h="number"==typeof e.limit?e.limit:-1,v=e.inclusive_end!==!1,y=gt(f,l,v,d,e.descending),m=y&&y.error;if(m&&("DataError"!==m.name||0!==m.code))return n(P(xo,m.name,m.message));var g=[Go,Ko,Qo];e.attachments&&g.push(Vo);var _=ht(t,g,"readonly");if(_.error)return n(_.error);var b=_.txn;b.oncomplete=c,b.onabort=at(n);var w,E=b.objectStore(Go),S=b.objectStore(Ko),O=b.objectStore(Qo),x=S.index("_doc_id_rev"),A=[];return O.get(Qo).onsuccess=function(e){w=e.target.result.docCount},m||0===h?void 0:h===-1?mt(E,y,u):void yt(E,y,e.descending,h+p,a)}function bt(e){return new to(function(t){var n=Me([""]),r=e.objectStore($o).put(n,"key");r.onsuccess=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)},e.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)}}).catch(function(){return!1})}function wt(e,t){var n=e.objectStore(Go).index("deletedOrLocal");n.count(IDBKeyRange.only("0")).onsuccess=function(e){t(e.target.result)}}function Et(e,t,n,r){try{e(t,n)}catch(e){r.emit("error",e)}}function St(){!Zo&&ei.length&&(Zo=!0,ei.shift()())}function Ot(e,t,n){ei.push(function(){e(function(e,r){Et(t,e,r,n),Zo=!1,$r(function(){St(n)})})}),St()}function xt(e,t,n,r){function o(t,n,r){function o(t,n){var r=e.processChange(n,t,e);d=r.seq=t.seq;var o=w(r);return"object"==typeof o?e.complete(o):void(o&&(b++,h&&_.push(r),e.attachments&&e.include_docs?lt(n,e,v,function(){dt([r],e.binary).then(function(){e.onChange(r)})}):e.onChange(r)))}function i(){for(var e=0,t=u.length;e<t&&b!==p;e++){var n=u[e];if(n){var i=s[e];o(i,n)}}b!==p&&r.continue()}if(r&&t.length){var u=new Array(t.length),s=new Array(t.length),c=0;n.forEach(function(e,n){var r=ct(e),o=t[n];a(r,o,function(e,r){s[n]=e,u[n]=r,++c===t.length&&i()})})}}function i(e,t,n,r){if(n.seq!==t)return r();if(n.winningRev===e._rev)return r(n,e);var o=e._id+"::"+n.winningRev,i=g.get(o);i.onsuccess=function(e){r(n,ct(e.target.result))}}function a(e,t,n){if(l&&!l.has(e._id))return n();var r=E.get(e._id);return r?i(e,t,r,n):void(m.get(e._id).onsuccess=function(o){r=st(o.target.result),E.set(e._id,r),i(e,t,r,n)})}function u(){e.complete(null,{results:_,last_seq:d})}function c(){!e.continuous&&e.attachments?dt(_).then(u):u()}if(e=s(e),e.continuous){var f=n+":"+J();return Yo.addListener(n,f,t,e),Yo.notify(n),{cancel:function(){Yo.removeListener(n,f)}}}var l=e.doc_ids&&new io(e.doc_ids);e.since=e.since||0;var d=e.since,p="limit"in e?e.limit:-1;0===p&&(p=1);var h;h="return_docs"in e?e.return_docs:!("returnDocs"in e)||e.returnDocs;var v,y,m,g,_=[],b=0,w=q(e),E=new ao,S=[Go,Ko];e.attachments&&S.push(Vo);var O=ht(r,S,"readonly");if(O.error)return e.complete(O.error);v=O.txn,v.onabort=at(e.complete),v.oncomplete=c,y=v.objectStore(Ko),m=v.objectStore(Go),g=y.index("_doc_id_rev");var x=e.since&&!e.descending?IDBKeyRange.lowerBound(e.since,!0):null;yt(y,x,e.descending,p,o)}function At(e,t){var n=this;Ot(function(t){jt(n,e,t)},t,n.constructor)}function jt(e,t,n){function r(e){var t=e.createObjectStore(Go,{keyPath:"id"});e.createObjectStore(Ko,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(Vo,{keyPath:"digest"}),e.createObjectStore(Qo,{keyPath:"id",autoIncrement:!1}),e.createObjectStore($o),t.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),e.createObjectStore(Xo,{keyPath:"_id"});var n=e.createObjectStore(zo,{autoIncrement:!0});n.createIndex("seq","seq"),n.createIndex("digestSeq","digestSeq",{unique:!0})}function o(e,t){var n=e.objectStore(Go);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=r.value,i=ce(o);o.deletedOrLocal=i?"1":"0",n.put(o),r.continue()}else t()}}function i(e){e.createObjectStore(Xo,{keyPath:"_id"}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0})}function a(e,t){var n=e.objectStore(Xo),r=e.objectStore(Go),o=e.objectStore(Ko),i=r.openCursor();i.onsuccess=function(e){var i=e.target.result;if(i){var a=i.value,u=a.id,s=fe(u),c=G(a);if(s){var f=u+"::"+c,l=u+"::",d=u+"::~",p=o.index("_doc_id_rev"),h=IDBKeyRange.bound(l,d,!1,!1),v=p.openCursor(h);v.onsuccess=function(e){if(v=e.target.result){var t=v.value;t._doc_id_rev===f&&n.put(t),o.delete(v.primaryKey),v.continue()}else r.delete(i.primaryKey),i.continue()}}else i.continue()}else t&&t()}}function u(e){var t=e.createObjectStore(zo,{autoIncrement:!0});t.createIndex("seq","seq"),t.createIndex("digestSeq","digestSeq",{unique:!0})}function s(e,t){var n=e.objectStore(Ko),r=e.objectStore(Vo),o=e.objectStore(zo),i=r.count();i.onsuccess=function(e){var r=e.target.result;return r?void(n.openCursor().onsuccess=function(e){var n=e.target.result;if(!n)return t();for(var r=n.value,i=n.primaryKey,a=Object.keys(r._attachments||{}),u={},s=0;s<a.length;s++){var c=r._attachments[a[s]];u[c.digest]=!0}var f=Object.keys(u);for(s=0;s<f.length;s++){var l=f[s];o.put({seq:i,digestSeq:l+"::"+i})}n.continue()}):t()}}function c(e){function t(e){return e.data?st(e):(e.deleted="1"===e.deletedOrLocal,e)}var n=e.objectStore(Ko),r=e.objectStore(Go),o=r.openCursor();o.onsuccess=function(e){function o(){var e=u.id+"::",t=u.id+"::￿",r=n.index("_doc_id_rev").openCursor(IDBKeyRange.bound(e,t)),o=0;r.onsuccess=function(e){var t=e.target.result;if(!t)return u.seq=o,i();var n=t.primaryKey;n>o&&(o=n),t.continue()}}function i(){var e=ut(u,u.winningRev,u.deleted),t=r.put(e);t.onsuccess=function(){a.continue()}}var a=e.target.result;if(a){var u=t(a.value);return u.winningRev=u.winningRev||G(u),u.seq?i():void o()}}}var l=t.name,d=null;e._meta=null,e.type=function(){return"idb"},e._id=f(function(t){t(null,e._meta.instanceId)}),e._bulkDocs=function(n,r,o){vt(t,n,r,e,d,o)},e._get=function(e,t,n){function r(){n(a,{doc:o,metadata:i,ctx:u})}var o,i,a,u=t.ctx;if(!u){var s=ht(d,[Go,Ko,Vo],"readonly");if(s.error)return n(s.error);u=s.txn}u.objectStore(Go).get(e).onsuccess=function(e){if(i=st(e.target.result),!i)return a=P(ho,"missing"),r();var n;if(t.rev)n=t.latest?le(t.rev,i):t.rev;else{n=i.winningRev;var s=ce(i);if(s)return a=P(ho,"deleted"),r()}var c=u.objectStore(Ko),f=i.id+"::"+n;c.index("_doc_id_rev").get(f).onsuccess=function(e){return o=e.target.result,o&&(o=ct(o)),o?void r():(a=P(ho,"missing"),r())}}},e._getAttachment=function(e,t,n,r,o){var i;if(r.ctx)i=r.ctx;else{var a=ht(d,[Go,Ko,Vo],"readonly");if(a.error)return o(a.error);i=a.txn}var u=n.digest,s=n.content_type;i.objectStore(Vo).get(u).onsuccess=function(e){var t=e.target.result.body;ft(t,s,r.binary,function(e){o(null,e)})}},e._info=function(t){var n,r,o=ht(d,[Qo,Ko],"readonly");if(o.error)return t(o.error);var i=o.txn;i.objectStore(Qo).get(Qo).onsuccess=function(e){r=e.target.result.docCount},i.objectStore(Ko).openCursor(null,"prev").onsuccess=function(e){var t=e.target.result;n=t?t.key:0},i.oncomplete=function(){t(null,{doc_count:r,update_seq:n,idb_attachment_format:e._meta.blobSupport?"binary":"base64"})}},e._allDocs=function(e,t){_t(e,d,t)},e._changes=function(t){xt(t,e,l,d)},e._close=function(e){d.close(),ti.delete(l),e()},e._getRevisionTree=function(e,t){var n=ht(d,[Go],"readonly");if(n.error)return t(n.error);var r=n.txn,o=r.objectStore(Go).get(e);o.onsuccess=function(e){var n=st(e.target.result);n?t(null,n.rev_tree):t(P(ho))}},e._doCompaction=function(e,t,n){var r=[Go,Ko,Vo,zo],o=ht(d,r,"readwrite");if(o.error)return n(o.error);var i=o.txn,a=i.objectStore(Go);a.get(e).onsuccess=function(n){var r=st(n.target.result);K(r.rev_tree,function(e,n,r,o,i){var a=n+"-"+r;t.indexOf(a)!==-1&&(i.status="missing")}),pt(t,e,i);var o=r.winningRev,a=r.deleted;i.objectStore(Go).put(ut(r,o,a))},i.onabort=at(n),i.oncomplete=function(){n()}},e._getLocal=function(e,t){var n=ht(d,[Xo],"readonly");if(n.error)return t(n.error);var r=n.txn,o=r.objectStore(Xo).get(e);o.onerror=at(t),o.onsuccess=function(e){var n=e.target.result;n?(delete n._doc_id_rev,t(null,n)):t(P(ho))}},e._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),delete e._revisions;var r=e._rev,o=e._id;r?e._rev="0-"+(parseInt(r.split("-")[1],10)+1):e._rev="0-1";var i,a=t.ctx;if(!a){var u=ht(d,[Xo],"readwrite");if(u.error)return n(u.error);a=u.txn,a.onerror=at(n),a.oncomplete=function(){i&&n(null,i)}}var s,c=a.objectStore(Xo);r?(s=c.get(o),s.onsuccess=function(o){var a=o.target.result;if(a&&a._rev===r){var u=c.put(e);u.onsuccess=function(){i={ok:!0,id:e._id,rev:e._rev},t.ctx&&n(null,i)}}else n(P(vo))}):(s=c.add(e),s.onerror=function(e){n(P(vo)),e.preventDefault(),e.stopPropagation()},s.onsuccess=function(){i={ok:!0,id:e._id,rev:e._rev},t.ctx&&n(null,i)})},e._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={});var r=t.ctx;if(!r){var o=ht(d,[Xo],"readwrite");if(o.error)return n(o.error);r=o.txn,r.oncomplete=function(){i&&n(null,i)}}var i,a=e._id,u=r.objectStore(Xo),s=u.get(a);s.onerror=at(n),s.onsuccess=function(r){var o=r.target.result;o&&o._rev===e._rev?(u.delete(a),i={ok:!0,id:a,rev:"0-0"},t.ctx&&n(null,i)):n(P(ho))}},e._destroy=function(e,t){Yo.removeAllListeners(l);var n=ni.get(l);n&&n.result&&(n.result.close(),ti.delete(l));var r=indexedDB.deleteDatabase(l);r.onsuccess=function(){ni.delete(l),E()&&l in localStorage&&delete localStorage[l],t(null,{ok:!0})},r.onerror=at(t)};var p=ti.get(l);if(p)return d=p.idb,e._meta=p.global,$r(function(){n(null,e)});var h;h=t.storage?kt(l,t.storage):indexedDB.open(l,Jo),ni.set(l,h),h.onupgradeneeded=function(e){function t(){var e=l[d-1];d++,e&&e(f,t)}var n=e.target.result;if(e.oldVersion<1)return r(n);var f=e.currentTarget.transaction;e.oldVersion<3&&i(n),e.oldVersion<4&&u(n);var l=[o,a,s,c],d=e.oldVersion;t()},h.onsuccess=function(t){function r(){"undefined"!=typeof u&&f&&(e._meta={name:l,instanceId:s,blobSupport:u},ti.set(l,{idb:d,global:e._meta}),n(null,e))}function o(){if("undefined"!=typeof a&&"undefined"!=typeof i){var e=l+"_id";e in i?s=i[e]:i[e]=s=J(),i.docCount=a,c.objectStore(Qo).put(i)}}d=t.target.result,d.onversionchange=function(){d.close(),ti.delete(l)},d.onabort=function(e){x("error","Database has a global failure",e.target.error),d.close(),ti.delete(l)};var i,a,u,s,c=d.transaction([Qo,$o,Go],"readwrite"),f=!1;c.objectStore(Qo).get(Qo).onsuccess=function(e){i=e.target.result||{id:Qo},o()},wt(c,function(e){a=e,o()}),Do||(Do=bt(c)),Do.then(function(e){u=e,r()}),c.oncomplete=function(){f=!0,r()}},h.onerror=function(){var e="Failed to open indexedDB, are you in private browsing mode?";x("error",e),n(P(xo,e))}}function kt(e,t){try{return indexedDB.open(e,{version:Jo,storage:t})}catch(t){return indexedDB.open(e,Jo)}}function Rt(e){return decodeURIComponent(escape(e))}function Pt(e){return e<65?e-48:e-55}function Tt(e,t,n){for(var r="";t<n;)r+=String.fromCharCode(Pt(e.charCodeAt(t++))<<4|Pt(e.charCodeAt(t++)));return r}function Ct(e,t,n){for(var r="";t<n;)r+=String.fromCharCode(Pt(e.charCodeAt(t+2))<<12|Pt(e.charCodeAt(t+3))<<8|Pt(e.charCodeAt(t))<<4|Pt(e.charCodeAt(t+1))),t+=4;return r}function qt(e,t){return"UTF-8"===t?Rt(Tt(e,0,e.length)):Ct(e,0,e.length)}function Lt(e){return"'"+e+"'"}function Mt(e){return e.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"")}function It(e){return e.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,"")}function Dt(e){return delete e._id,delete e._rev,JSON.stringify(e)}function Nt(e,t,n){return e=JSON.parse(e),e._id=t,e._rev=n,e}function Bt(e){for(var t="(";e--;)t+="?",e&&(t+=",");return t+")"}function Ut(e,t,n,r,o){return"SELECT "+e+" FROM "+("string"==typeof t?t:t.join(" JOIN "))+(n?" ON "+n:"")+(r?" WHERE "+("string"==typeof r?r:r.join(" AND ")):"")+(o?" ORDER BY "+o:"")}function Ft(e,t,n){function r(){++i===e.length&&o()}function o(){if(a.length){var e="SELECT DISTINCT digest AS digest FROM "+fi+" WHERE seq IN "+Bt(a.length);n.executeSql(e,a,function(e,t){for(var n=[],r=0;r<t.rows.length;r++)n.push(t.rows.item(r).digest);if(n.length){var o="DELETE FROM "+fi+" WHERE seq IN ("+a.map(function(){return"?"}).join(",")+")";e.executeSql(o,a,function(e){var t="SELECT digest FROM "+fi+" WHERE digest IN ("+n.map(function(){return"?"}).join(",")+")";e.executeSql(t,n,function(e,t){for(var r=new io,o=0;o<t.rows.length;o++)r.add(t.rows.item(o).digest);n.forEach(function(t){r.has(t)||(e.executeSql("DELETE FROM "+fi+" WHERE digest=?",[t]),e.executeSql("DELETE FROM "+ui+" WHERE digest=?",[t]))})})})}})}}if(e.length){var i=0,a=[];e.forEach(function(e){var o="SELECT seq FROM "+ai+" WHERE doc_id=? AND rev=?";n.executeSql(o,[t,e],function(e,t){if(!t.rows.length)return r();var n=t.rows.item(0).seq;a.push(n),e.executeSql("DELETE FROM "+ai+" WHERE seq=?",[n],r)})})}}function Ht(e){return function(t){x("error","WebSQL threw an error",t);var n=t&&t.constructor.toString().match(/function ([^\(]+)/),r=n&&n[1]||t.type,o=t.target||t.message;e(P(Ao,o,r))}}function Wt(e){if("size"in e)return 1e6*e.size;var t="undefined"!=typeof navigator&&/Android/.test(navigator.userAgent);return t?5e6:1}function Jt(e,t,n,r,o,i,a){function u(){return _?a(_):(i.notify(r._name),void a(null,b))}function s(e,t){var n="SELECT count(*) as cnt FROM "+ui+" WHERE digest=?";g.executeSql(n,[e],function(n,r){if(0===r.rows.item(0).cnt){var o=P(ko,"unknown stub attachment with digest "+e);t(o)}else t()})}function c(e){function t(){++o===n.length&&e(r)}var n=[];if(y.forEach(function(e){e.data&&e.data._attachments&&Object.keys(e.data._attachments).forEach(function(t){var r=e.data._attachments[t];r.stub&&n.push(r.digest)})}),!n.length)return e();var r,o=0;n.forEach(function(e){s(e,function(e){e&&!r&&(r=e),t()})})}function f(e,t,n,o,i,a,u,s){function c(){function t(e,t){function r(){return++i===a.length&&t(),!1}function o(t){var o="INSERT INTO "+fi+" (digest, seq) VALUES (?,?)",i=[n._attachments[t].digest,e];g.executeSql(o,i,r,r)}var i=0,a=Object.keys(n._attachments||{});if(!a.length)return t();for(var u=0;u<a.length;u++)o(a[u])}var n=e.data,r=o?1:0,i=n._id,a=n._rev,u=Dt(n),s="INSERT INTO "+ai+" (doc_id, rev, json, deleted) VALUES (?, ?, ?, ?);",c=[i,a,u,r];g.executeSql(s,c,function(e,n){var r=n.insertId;t(r,function(){d(e,r)})},function(){var e=Ut("seq",ai,null,"doc_id=? AND rev=?");return g.executeSql(e,[i,a],function(e,n){var o=n.rows.item(0).seq,s="UPDATE "+ai+" SET json=?, deleted=? WHERE doc_id=? AND rev=?;",c=[u,r,i,a];e.executeSql(s,c,function(e){t(o,function(){d(e,o)})})}),!1})}function f(e){h||(e?(h=e,s(h)):v===y.length&&c())}function l(e){v++,f(e)}function d(n,o){var a=e.metadata.id,c=e.stemmedRevs||[];i&&r.auto_compaction&&(c=X(e.metadata).concat(c)),c.length&&Ft(c,a,n),e.metadata.seq=o;var f=e.metadata.rev;delete e.metadata.rev;var l=i?"UPDATE "+ii+" SET json=?, max_seq=?, winningseq=(SELECT seq FROM "+ai+" WHERE doc_id="+ii+".id AND rev=?) WHERE id=?":"INSERT INTO "+ii+" (id, winningseq, max_seq, json) VALUES (?,?,?,?);",d=it(e.metadata),p=i?[d,o,t,a]:[a,o,o,d];n.executeSql(l,p,function(){b[u]={ok:!0,id:e.metadata.id,rev:f},w.set(a,e.metadata),s()})}var h=null,v=0;e.data._id=e.metadata.id,e.data._rev=e.metadata.rev;var y=Object.keys(e.data._attachments||{});o&&(e.data._deleted=!0),y.forEach(function(n){var r=e.data._attachments[n];if(r.stub)v++,f();else{var o=r.data;delete r.data,r.revpos=parseInt(t,10);var i=r.digest;p(i,o,l)}}),y.length||c()}function l(){rt(e.revs_limit,y,r,w,g,b,f,n)}function d(e){function t(){++n===y.length&&e()}if(!y.length)return e();var n=0;y.forEach(function(e){if(e._id&&fe(e._id))return t();var n=e.metadata.id;g.executeSql("SELECT json FROM "+ii+" WHERE id = ?",[n],function(e,r){if(r.rows.length){var o=ot(r.rows.item(0).json);w.set(n,o)}t()})})}function p(e,t,n){var r="SELECT digest FROM "+ui+" WHERE digest=?";g.executeSql(r,[e],function(o,i){return i.rows.length?n():(r="INSERT INTO "+ui+" (digest, body, escaped) VALUES (?,?,1)",void o.executeSql(r,[e,Mt(t)],function(){n()},function(){return n(),!1}))})}var h=n.new_edits,v=t.docs,y=v.map(function(e){if(e._id&&fe(e._id))return e;var t=Le(e,h);return t}),m=y.filter(function(e){return e.error});if(m.length)return a(m[0]);var g,_,b=new Array(y.length),w=new ao;et(y,"binary",function(e){return e?a(e):void o.transaction(function(e){g=e,c(function(e){e?_=e:d(l)})},Ht(a),u)})}function Gt(e){return e.websql(e.name,e.version,e.description,e.size)}function Kt(e){try{return{db:Gt(e)}}catch(e){return{error:e}}}function Vt(e){var t=li.get(e.name);return t||(t=Kt(e),li.set(e.name,t)),t}function zt(e,t,n,r,o){function i(){++s===u.length&&o&&o()}function a(e,o){var a=e._attachments[o],u={binary:t.binary,ctx:r};n._getAttachment(e._id,o,a,u,function(t,n){e._attachments[o]=fo(d(a,["digest","content_type"]),{data:n}),i()})}var u=Object.keys(e._attachments||{});if(!u.length)return o&&o();var s=0;u.forEach(function(n){t.attachments&&t.include_docs?a(e,n):(e._attachments[n].stub=!0,i())})}function Qt(e,t){function n(){E()&&(window.localStorage["_pouch__websqldb_"+b._name]=!0),t(null,b)}function r(e,t){e.executeSql(yi),e.executeSql("ALTER TABLE "+ai+" ADD COLUMN deleted TINYINT(1) DEFAULT 0",[],function(){e.executeSql(hi),e.executeSql("ALTER TABLE "+ii+" ADD COLUMN local TINYINT(1) DEFAULT 0",[],function(){e.executeSql("CREATE INDEX IF NOT EXISTS 'doc-store-local-idx' ON "+ii+" (local, id)");var n="SELECT "+ii+".winningseq AS seq, "+ii+".json AS metadata FROM "+ai+" JOIN "+ii+" ON "+ai+".seq = "+ii+".winningseq";e.executeSql(n,[],function(e,n){for(var r=[],o=[],i=0;i<n.rows.length;i++){var a=n.rows.item(i),u=a.seq,s=JSON.parse(a.metadata);ce(s)&&r.push(u),fe(s.id)&&o.push(s.id)}e.executeSql("UPDATE "+ii+"SET local = 1 WHERE id IN "+Bt(o.length),o,function(){e.executeSql("UPDATE "+ai+" SET deleted = 1 WHERE seq IN "+Bt(r.length),r,t)})})})})}function o(e,t){var n="CREATE TABLE IF NOT EXISTS "+si+" (id UNIQUE, rev, json)";e.executeSql(n,[],function(){var n="SELECT "+ii+".id AS id, "+ai+".json AS data FROM "+ai+" JOIN "+ii+" ON "+ai+".seq = "+ii+".winningseq WHERE local = 1";e.executeSql(n,[],function(e,n){function r(){if(!o.length)return t(e);var n=o.shift(),i=JSON.parse(n.data)._rev;e.executeSql("INSERT INTO "+si+" (id, rev, json) VALUES (?,?,?)",[n.id,i,n.data],function(e){e.executeSql("DELETE FROM "+ii+" WHERE id=?",[n.id],function(e){e.executeSql("DELETE FROM "+ai+" WHERE seq=?",[n.seq],function(){r()})})})}for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i));r()})})}function i(e,t){function n(n){function r(){if(!n.length)return t(e);var o=n.shift(),i=qt(o.hex,_),a=i.lastIndexOf("::"),u=i.substring(0,a),s=i.substring(a+2),c="UPDATE "+ai+" SET doc_id=?, rev=? WHERE doc_id_rev=?";e.executeSql(c,[u,s,i],function(){r()})}r()}var r="ALTER TABLE "+ai+" ADD COLUMN doc_id";e.executeSql(r,[],function(e){var t="ALTER TABLE "+ai+" ADD COLUMN rev";e.executeSql(t,[],function(e){e.executeSql(vi,[],function(e){var t="SELECT hex(doc_id_rev) as hex FROM "+ai;e.executeSql(t,[],function(e,t){for(var r=[],o=0;o<t.rows.length;o++)r.push(t.rows.item(o));n(r)})})})})}function a(e,t){function n(e){var n="SELECT COUNT(*) AS cnt FROM "+ui;e.executeSql(n,[],function(e,n){function r(){var n=Ut(bi+", "+ii+".id AS id",[ii,ai],_i,null,ii+".id ");n+=" LIMIT "+a+" OFFSET "+i,i+=a,e.executeSql(n,[],function(e,n){function o(e,t){var n=i[e]=i[e]||[];n.indexOf(t)===-1&&n.push(t)}if(!n.rows.length)return t(e);for(var i={},a=0;a<n.rows.length;a++)for(var u=n.rows.item(a),s=Nt(u.data,u.id,u.rev),c=Object.keys(s._attachments||{}),f=0;f<c.length;f++){var l=s._attachments[c[f]];o(l.digest,u.seq)}var d=[];if(Object.keys(i).forEach(function(e){var t=i[e];t.forEach(function(t){d.push([e,t])})}),!d.length)return r();var p=0;d.forEach(function(t){var n="INSERT INTO "+fi+" (digest, seq) VALUES (?,?)";e.executeSql(n,t,function(){++p===d.length&&r()})})})}var o=n.rows.item(0).cnt;if(!o)return t(e);var i=0,a=10;r()})}var r="CREATE TABLE IF NOT EXISTS "+fi+" (digest, seq INTEGER)";e.executeSql(r,[],function(e){e.executeSql(gi,[],function(e){e.executeSql(mi,[],n)})})}function u(e,t){var n="ALTER TABLE "+ui+" ADD COLUMN escaped TINYINT(1) DEFAULT 0";e.executeSql(n,[],t)}function c(e,t){var n="ALTER TABLE "+ii+" ADD COLUMN max_seq INTEGER";e.executeSql(n,[],function(e){var n="UPDATE "+ii+" SET max_seq=(SELECT MAX(seq) FROM "+ai+" WHERE doc_id=id)";e.executeSql(n,[],function(e){var n="CREATE UNIQUE INDEX IF NOT EXISTS 'doc-max-seq-idx' ON "+ii+" (max_seq)";e.executeSql(n,[],t)})})}function l(e,t){e.executeSql('SELECT HEX("a") AS hex',[],function(e,n){var r=n.rows.item(0).hex;_=2===r.length?"UTF-8":"UTF-16",t()})}function d(){for(;O.length>0;){var e=O.pop();e(null,w)}}function p(e,t){if(0===t){var n="CREATE TABLE IF NOT EXISTS "+ci+" (dbid, db_version INTEGER)",s="CREATE TABLE IF NOT EXISTS "+ui+" (digest UNIQUE, escaped TINYINT(1), body BLOB)",f="CREATE TABLE IF NOT EXISTS "+fi+" (digest, seq INTEGER)",l="CREATE TABLE IF NOT EXISTS "+ii+" (id unique, json, winningseq, max_seq INTEGER UNIQUE)",p="CREATE TABLE IF NOT EXISTS "+ai+" (seq INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, json, deleted TINYINT(1), doc_id, rev)",h="CREATE TABLE IF NOT EXISTS "+si+" (id UNIQUE, rev, json)";e.executeSql(s),e.executeSql(h),e.executeSql(f,[],function(){e.executeSql(mi),e.executeSql(gi)}),e.executeSql(l,[],function(){e.executeSql(yi),e.executeSql(p,[],function(){e.executeSql(hi),e.executeSql(vi),e.executeSql(n,[],function(){var t="INSERT INTO "+ci+" (db_version, dbid) VALUES (?,?)";w=J();var n=[oi,w];e.executeSql(t,n,function(){d()})})})})}else{var v=function(){var n=t<oi;n&&e.executeSql("UPDATE "+ci+" SET db_version = "+oi);var r="SELECT dbid FROM "+ci;e.executeSql(r,[],function(e,t){w=t.rows.item(0).dbid,d()})},y=[r,o,i,a,u,c,v],m=t,g=function(e){y[m-1](e,g),m++};g(e)}}function h(){j.transaction(function(e){l(e,function(){v(e)})},Ht(t),n)}function v(e){var t="SELECT sql FROM sqlite_master WHERE tbl_name = "+ci;e.executeSql(t,[],function(e,t){t.rows.length?/db_version/.test(t.rows.item(0).sql)?e.executeSql("SELECT db_version FROM "+ci,[],function(e,t){var n=t.rows.item(0).db_version;p(e,n)}):e.executeSql("ALTER TABLE "+ci+" ADD COLUMN db_version INTEGER",[],function(){p(e,1)}):p(e,0)})}function y(e,t){var n="SELECT MAX(seq) AS seq FROM "+ai;e.executeSql(n,[],function(e,n){var r=n.rows.item(0).seq||0;t(r)})}function m(e,t){var n=Ut("COUNT("+ii+".id) AS 'num'",[ii,ai],_i,ai+".deleted=0");e.executeSql(n,[],function(e,n){t(n.rows.item(0).num)})}function g(e,t,n,r,o){var i=Ut(bi,[ii,ai],_i,ii+".id=?"),a=[t];e.executeSql(i,a,function(e,t){if(!t.rows.length){var i=P(ho,"missing");return o(i)}var a=t.rows.item(0),u=ot(a.metadata);r(le(n,u))})}var _,b=this,w=null,S=Wt(e),O=[];b._name=e.name;var x=fo({},e,{version:pi,description:e.name,size:S}),A=Vt(x);if(A.error)return Ht(t)(A.error);var j=A.db;"function"!=typeof j.readTransaction&&(j.readTransaction=j.transaction),h(),b.type=function(){return"websql"},b._id=f(function(e){e(null,w)}),b._info=function(e){var t,n;j.readTransaction(function(e){y(e,function(e){t=e}),m(e,function(e){n=e})},Ht(e),function(){e(null,{doc_count:n,update_seq:t,websql_encoding:_})})},b._bulkDocs=function(t,n,r){Jt(e,t,n,b,j,di,r)},b._get=function(e,t,n){function r(e){n(e,{doc:o,metadata:i,ctx:a})}var o,i,a=t.ctx;if(!a)return j.readTransaction(function(r){b._get(e,fo({ctx:r},t),n)});var u,s;if(t.rev){if(t.latest)return void g(a,e,t.rev,function(r){t.latest=!1,t.rev=r,b._get(e,t,n)},r);u=Ut(bi,[ii,ai],ii+".id="+ai+".doc_id",[ai+".doc_id=?",ai+".rev=?"]),s=[e,t.rev]}else u=Ut(bi,[ii,ai],_i,ii+".id=?"),s=[e];a.executeSql(u,s,function(e,n){if(!n.rows.length){var a=P(ho,"missing");return r(a)}var u=n.rows.item(0);if(i=ot(u.metadata),u.deleted&&!t.rev){var s=P(ho,"deleted");return r(s)}o=Nt(u.data,i.id,u.rev),r()})},b._allDocs=function(e,t){var n,r=[],o="startkey"in e&&e.startkey,i="endkey"in e&&e.endkey,a="key"in e&&e.key,u="descending"in e&&e.descending,s="limit"in e?e.limit:-1,c="skip"in e?e.skip:0,f=e.inclusive_end!==!1,l=[],d=[];if(a!==!1)d.push(ii+".id = ?"),l.push(a);else if(o!==!1||i!==!1){if(o!==!1&&(d.push(ii+".id "+(u?"<=":">=")+" ?"),l.push(o)),i!==!1){var p=u?">":"<";f&&(p+="="),d.push(ii+".id "+p+" ?"),l.push(i)}a!==!1&&(d.push(ii+".id = ?"),l.push(a))}"ok"!==e.deleted&&d.push(ai+".deleted = 0"),j.readTransaction(function(t){if(m(t,function(e){n=e}),0!==s){var o=Ut(bi,[ii,ai],_i,d,ii+".id "+(u?"DESC":"ASC"));o+=" LIMIT "+s+" OFFSET "+c,t.executeSql(o,l,function(t,n){for(var o=0,i=n.rows.length;o<i;o++){var a=n.rows.item(o),u=ot(a.metadata),s=u.id,c=Nt(a.data,s,a.rev),f=c._rev,l={id:s,key:s,value:{rev:f}};if(e.include_docs){if(l.doc=c,l.doc._rev=f,e.conflicts){var d=Q(u);d.length&&(l.doc._conflicts=d)}zt(l.doc,e,b,t)}if(a.deleted){if("ok"!==e.deleted)continue;l.value.deleted=!0,l.doc=null}r.push(l)}})}},Ht(t),function(){t(null,{total_rows:n,offset:e.skip,rows:r})})},b._changes=function(e){function t(){var t=ii+".json AS metadata, "+ii+".max_seq AS maxSeq, "+ai+".json AS winningDoc, "+ai+".rev AS winningRev ",n=ii+" JOIN "+ai,s=ii+".id="+ai+".doc_id AND "+ii+".winningseq="+ai+".seq",c=["maxSeq > ?"],f=[e.since];e.doc_ids&&(c.push(ii+".id IN "+Bt(e.doc_ids.length)),f=f.concat(e.doc_ids));var l="maxSeq "+(r?"DESC":"ASC"),d=Ut(t,n,s,c,l),p=q(e);e.view||e.filter||(d+=" LIMIT "+o);var h=e.since||0;j.readTransaction(function(t){t.executeSql(d,f,function(t,n){function r(t){return function(){e.onChange(t)}}for(var s=0,c=n.rows.length;s<c;s++){var f=n.rows.item(s),l=ot(f.metadata);h=f.maxSeq;var d=Nt(f.winningDoc,l.id,f.winningRev),v=e.processChange(d,l,e);v.seq=f.maxSeq;var y=p(v);if("object"==typeof y)return e.complete(y);if(y&&(u++,i&&a.push(v),e.attachments&&e.include_docs?zt(d,e,b,t,r(v)):r(v)()),u===o)break}})},Ht(e.complete),function(){e.continuous||e.complete(null,{results:a,last_seq:h})})}if(e=s(e),e.continuous){var n=b._name+":"+J();return di.addListener(b._name,n,b,e),di.notify(b._name),{cancel:function(){di.removeListener(b._name,n)}}}var r=e.descending;e.since=e.since&&!r?e.since:0;var o="limit"in e?e.limit:-1;0===o&&(o=1);var i;i="return_docs"in e?e.return_docs:!("returnDocs"in e)||e.returnDocs;var a=[],u=0;t()},b._close=function(e){e()},b._getAttachment=function(e,t,n,r,o){var i,a=r.ctx,u=n.digest,s=n.content_type,c="SELECT escaped, CASE WHEN escaped = 1 THEN body ELSE HEX(body) END AS body FROM "+ui+" WHERE digest=?";a.executeSql(c,[u],function(e,t){var n=t.rows.item(0),a=n.escaped?It(n.body):qt(n.body,_);i=r.binary?De(a,s):Fo(a),o(null,i)})},b._getRevisionTree=function(e,t){j.readTransaction(function(n){var r="SELECT json AS metadata FROM "+ii+" WHERE id = ?";n.executeSql(r,[e],function(e,n){if(n.rows.length){var r=ot(n.rows.item(0).metadata);t(null,r.rev_tree)}else t(P(ho))})})},b._doCompaction=function(e,t,n){return t.length?void j.transaction(function(n){var r="SELECT json AS metadata FROM "+ii+" WHERE id = ?";n.executeSql(r,[e],function(n,r){var o=ot(r.rows.item(0).metadata);K(o.rev_tree,function(e,n,r,o,i){var a=n+"-"+r;t.indexOf(a)!==-1&&(i.status="missing")});var i="UPDATE "+ii+" SET json = ? WHERE id = ?";n.executeSql(i,[it(o),e])}),Ft(t,e,n)},Ht(n),function(){n()}):n()},b._getLocal=function(e,t){j.readTransaction(function(n){var r="SELECT json, rev FROM "+si+" WHERE id=?";n.executeSql(r,[e],function(n,r){if(r.rows.length){var o=r.rows.item(0),i=Nt(o.json,e,o.rev);t(null,i)}else t(P(ho))})})},b._putLocal=function(e,t,n){function r(e){var r,c;i?(r="UPDATE "+si+" SET rev=?, json=? WHERE id=? AND rev=?",c=[o,s,a,i]):(r="INSERT INTO "+si+" (id, rev, json) VALUES (?,?,?)",c=[a,o,s]),e.executeSql(r,c,function(e,r){r.rowsAffected?(u={ok:!0,id:a,rev:o},t.ctx&&n(null,u)):n(P(vo))},function(){return n(P(vo)),!1})}"function"==typeof t&&(n=t,t={}),delete e._revisions;var o,i=e._rev,a=e._id;o=i?e._rev="0-"+(parseInt(i.split("-")[1],10)+1):e._rev="0-1";var u,s=Dt(e);t.ctx?r(t.ctx):j.transaction(r,Ht(n),function(){u&&n(null,u)})},b._removeLocal=function(e,t,n){function r(r){var i="DELETE FROM "+si+" WHERE id=? AND rev=?",a=[e._id,e._rev];r.executeSql(i,a,function(r,i){return i.rowsAffected?(o={ok:!0,id:e._id,rev:"0-0"},void(t.ctx&&n(null,o))):n(P(ho))})}"function"==typeof t&&(n=t,t={});var o;t.ctx?r(t.ctx):j.transaction(r,Ht(n),function(){o&&n(null,o)})},b._destroy=function(e,t){di.removeAllListeners(b._name),j.transaction(function(e){var t=[ii,ai,ui,ci,si,fi];t.forEach(function(t){e.executeSql("DROP TABLE IF EXISTS "+t,[])})},Ht(t),function(){E()&&(delete window.localStorage["_pouch__websqldb_"+b._name],delete window.localStorage[b._name]),t(null,{ok:!0})})}}function Xt(){try{return openDatabase("_pouch_validate_websql",1,"",1),!0}catch(e){return!1}}function $t(){if("undefined"==typeof indexedDB||null===indexedDB||!/iP(hone|od|ad)/.test(navigator.userAgent))return!0;var e=E(),t="_pouch__websqldb_valid_"+navigator.userAgent;if(e&&localStorage[t])return"1"===localStorage[t];var n=Xt();return e&&(localStorage[t]=n?"1":"0"),n}function Yt(){return"function"==typeof openDatabase&&$t()}function Zt(e,t,n,r){return openDatabase(e,t,n,r)}function en(e,t){var n=fo({websql:Zt},e);Qt.call(this,n,t)}function tn(){for(var e={},t=new to(function(t,n){e.resolve=t,e.reject=n}),n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.promise=t,to.resolve().then(function(){return fetch.apply(null,n);
}).then(function(t){e.resolve(t)}).catch(function(t){e.reject(t)}),e}function nn(e,t){var n,r,o,i=new Headers,a={method:e.method,credentials:"include",headers:i};return e.json&&(i.set("Accept","application/json"),i.set("Content-Type",e.headers["Content-Type"]||"application/json")),e.body&&e.processData&&"string"!=typeof e.body?a.body=JSON.stringify(e.body):"body"in e?a.body=e.body:a.body=null,Object.keys(e.headers).forEach(function(t){e.headers.hasOwnProperty(t)&&i.set(t,e.headers[t])}),n=tn(e.url,a),e.timeout>0&&(r=setTimeout(function(){n.reject(new Error("Load timeout for resource: "+e.url))},e.timeout)),n.promise.then(function(t){return o={statusCode:t.status},e.timeout>0&&clearTimeout(r),o.statusCode>=200&&o.statusCode<300?e.binary?t.blob():t.text():t.json()}).then(function(e){o.statusCode>=200&&o.statusCode<300?t(null,o,e):(e.status=o.statusCode,t(e))}).catch(function(e){e||(e=new Error("canceled")),t(e)}),{abort:n.reject}}function rn(e,t){var n,r,o=!1,i=function(){n.abort(),s()},a=function(){o=!0,n.abort(),s()},u={abort:i},s=function(){clearTimeout(r),u.abort=function(){},n&&(n.onprogress=void 0,n.upload&&(n.upload.onprogress=void 0),n.onreadystatechange=void 0,n=void 0)};n=e.xhr?new e.xhr:new XMLHttpRequest;try{n.open(e.method,e.url)}catch(e){return t(new Error(e.name||"Url is invalid"))}n.withCredentials=!("withCredentials"in e)||e.withCredentials,"GET"===e.method?delete e.headers["Content-Type"]:e.json&&(e.headers.Accept="application/json",e.headers["Content-Type"]=e.headers["Content-Type"]||"application/json",e.body&&e.processData&&"string"!=typeof e.body&&(e.body=JSON.stringify(e.body))),e.binary&&(n.responseType="arraybuffer"),"body"in e||(e.body=null);for(var c in e.headers)e.headers.hasOwnProperty(c)&&n.setRequestHeader(c,e.headers[c]);return e.timeout>0&&(r=setTimeout(a,e.timeout),n.onprogress=function(){clearTimeout(r),4!==n.readyState&&(r=setTimeout(a,e.timeout))},"undefined"!=typeof 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 i;i=e.binary?Me([n.response||""],{type:n.getResponseHeader("Content-Type")}):n.responseText,t(null,r,i)}else{var a={};if(o)a=new Error("ETIMEDOUT"),a.code="ETIMEDOUT";else if("string"==typeof n.response)try{a=JSON.parse(n.response)}catch(e){}a.status=n.status,t(a)}s()}},e.body&&e.body instanceof Blob?We(e.body,function(e){n.send(e)}):n.send(e.body),u}function on(){try{return new XMLHttpRequest,!0}catch(e){return!1}}function an(e,t){return Ei||e.xhr?rn(e,t):nn(e,t)}function un(){return""}function sn(e,t){function n(t,n,r){if(!e.binary&&e.json&&"string"==typeof t)try{t=JSON.parse(t)}catch(e){return r(e)}Array.isArray(t)&&(t=t.map(function(e){return e.error||e.missing?T(e):e})),e.binary&&Si(t,n),r(null,t,n)}e=s(e);var r={method:"GET",headers:{},json:!0,processData:!0,timeout:1e4,cache:!1};return e=fo(r,e),e.json&&(e.binary||(e.headers.Accept="application/json"),e.headers["Content-Type"]=e.headers["Content-Type"]||"application/json"),e.binary&&(e.encoding=null,e.json=!1),e.processData||(e.json=!1),an(e,function(r,o,i){if(r)return t(T(r));var a,u=o.headers&&o.headers["content-type"],s=i||un();if(!e.binary&&(e.json||!e.processData)&&"object"!=typeof s&&(/json/.test(u)||/^[\s]*\{/.test(s)&&/\}[\s]*$/.test(s)))try{s=JSON.parse(s.toString())}catch(e){}o.statusCode>=200&&o.statusCode<300?n(s,o,t):(a=T(s),a.status=o.statusCode,t(a))})}function cn(e,t){var n=navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",r=n.indexOf("safari")!==-1&&n.indexOf("chrome")===-1,o=n.indexOf("msie")!==-1,i=n.indexOf("edge")!==-1,a=r||(o||i)&&"GET"===e.method,u=!("cache"in e)||e.cache,s=/^blob:/.test(e.url);if(!s&&(a||!u)){var c=e.url.indexOf("?")!==-1;e.url+=(c?"&":"?")+"_nonce="+Date.now()}return sn(e,t)}function fn(e,t){return new to(function(n,r){function o(){f++,e[l++]().then(a,u)}function i(){++d===p?c?r(c):n():s()}function a(){f--,i()}function u(e){f--,c=c||e,i()}function s(){for(;f<t&&l<p;)o()}var c,f=0,l=0,d=0,p=e.length;s()})}function ln(e){var t=e.doc&&e.doc._attachments;t&&Object.keys(t).forEach(function(e){var n=t[e];n.data=Ne(n.data,n.content_type)})}function dn(e){return/^_design/.test(e)?"_design/"+encodeURIComponent(e.slice(8)):/^_local/.test(e)?"_local/"+encodeURIComponent(e.slice(7)):encodeURIComponent(e)}function pn(e){return e._attachments&&Object.keys(e._attachments)?to.all(Object.keys(e._attachments).map(function(t){var n=e._attachments[t];if(n.data&&"string"!=typeof n.data)return new to(function(e){He(n.data,e)}).then(function(e){n.data=e})})):to.resolve()}function hn(e){if(!e.prefix)return!1;var t=U(e.prefix).protocol;return"http"===t||"https"===t}function vn(e,t){if(hn(t)){var n=t.name.substr(t.prefix.length);e=t.prefix+encodeURIComponent(n)}var r=U(e);(r.user||r.password)&&(r.auth={username:r.user,password:r.password});var o=r.path.replace(/(^\/|\/$)/g,"").split("/");return r.db=o.pop(),r.db.indexOf("%")===-1&&(r.db=encodeURIComponent(r.db)),r.path=o.join("/"),r}function yn(e,t){return mn(e,e.db+"/"+t)}function mn(e,t){var n=e.path?"/":"";return e.protocol+"://"+e.host+(e.port?":"+e.port:"")+"/"+e.path+n+t}function gn(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function _n(e,t){function n(e,t,n){var r=e.ajax||{},o=fo(s(p),r,t);return ji(o.method+" "+o.url),u._ajax(o,n)}function r(e,t){return new to(function(r,o){n(e,t,function(e,t){return e?o(e):void r(t)})})}function o(e,t){return l(e,Vr(function(e){i().then(function(){return t.apply(this,e)}).catch(function(t){var n=e.pop();n(t)})}))}function i(){if(e.skipSetup||e.skip_setup)return to.resolve();if(m)return m;var t={method:"GET",url:f};return m=r({},t).catch(function(e){return e&&e.status&&404===e.status?(k(404,"PouchDB is just detecting if the remote exists."),r({},{method:"PUT",url:f})):to.reject(e)}).catch(function(e){return!(!e||!e.status||412!==e.status)||to.reject(e)}),m.catch(function(){m=null}),m}function a(e){return e.split("/").map(encodeURIComponent).join("/")}var u=this,c=vn(e.name,e),f=yn(c,"");e=s(e);var p=e.ajax||{};if(e.auth||c.auth){var h=e.auth||c.auth,v=h.username+":"+h.password,y=Fo(unescape(encodeURIComponent(v)));p.headers=p.headers||{},p.headers.Authorization="Basic "+y}u._ajax=cn;var m;$r(function(){t(null,u)}),u.type=function(){return"http"},u.id=o("id",function(e){n({},{method:"GET",url:mn(c,"")},function(t,n){var r=n&&n.uuid?n.uuid+c.db:yn(c,"");e(null,r)})}),u.request=o("request",function(e,t){e.url=yn(c,e.url),n({},e,t)}),u.compact=o("compact",function(e,t){"function"==typeof e&&(t=e,e={}),e=s(e),n(e,{url:yn(c,"_compact"),method:"POST"},function(){function n(){u.info(function(r,o){o&&!o.compact_running?t(null,{ok:!0}):setTimeout(n,e.interval||200)})}n()})}),u.bulkGet=l("bulkGet",function(e,t){function r(t){var r={};e.revs&&(r.revs=!0),e.attachments&&(r.attachments=!0),e.latest&&(r.latest=!0),n(e,{url:yn(c,"_bulk_get"+gn(r)),method:"POST",body:{docs:e.docs}},t)}function o(){function n(e){return function(n,r){u[e]=r.results,++a===o&&t(null,{results:L(u)})}}for(var r=xi,o=Math.ceil(e.docs.length/r),a=0,u=new Array(o),s=0;s<o;s++){var c=d(e,["revs","attachments","latest"]);c.ajax=p,c.docs=e.docs.slice(s*r,Math.min(e.docs.length,(s+1)*r)),b(i,c,n(s))}}var i=this,a=mn(c,""),u=Ai[a];"boolean"!=typeof u?r(function(e,n){e?(Ai[a]=!1,k(e.status,"PouchDB is just detecting if the remote supports the _bulk_get API."),o()):(Ai[a]=!0,t(null,n))}):u?r(t):o()}),u._info=function(e){i().then(function(){n({},{method:"GET",url:yn(c,"")},function(t,n){return t?e(t):(n.host=yn(c,""),void e(null,n))})}).catch(e)},u.get=o("get",function(e,t,n){function o(e){function n(n){var i=o[n],u=dn(e._id)+"/"+a(n)+"?rev="+e._rev;return r(t,{method:"GET",url:yn(c,u),binary:!0}).then(function(e){return t.binary?e:new to(function(t){He(e,t)})}).then(function(e){delete i.stub,delete i.length,i.data=e})}var o=e._attachments,i=o&&Object.keys(o);if(o&&i.length){var u=i.map(function(e){return function(){return n(e)}});return fn(u,5)}}function i(e){return Array.isArray(e)?to.all(e.map(function(e){if(e.ok)return o(e.ok)})):o(e)}"function"==typeof t&&(n=t,t={}),t=s(t);var u={};t.revs&&(u.revs=!0),t.revs_info&&(u.revs_info=!0),t.latest&&(u.latest=!0),t.open_revs&&("all"!==t.open_revs&&(t.open_revs=JSON.stringify(t.open_revs)),u.open_revs=t.open_revs),t.rev&&(u.rev=t.rev),t.conflicts&&(u.conflicts=t.conflicts),e=dn(e);var f={method:"GET",url:yn(c,e+gn(u))};r(t,f).then(function(e){return to.resolve().then(function(){if(t.attachments)return i(e)}).then(function(){n(null,e)})}).catch(n)}),u.remove=o("remove",function(e,t,r,o){var i;"string"==typeof t?(i={_id:e,_rev:t},"function"==typeof r&&(o=r,r={})):(i=e,"function"==typeof t?(o=t,r={}):(o=r,r=t));var a=i._rev||r.rev;n(r,{method:"DELETE",url:yn(c,dn(i._id))+"?rev="+a},o)}),u.getAttachment=o("getAttachment",function(e,t,r,o){"function"==typeof r&&(o=r,r={});var i=r.rev?"?rev="+r.rev:"",u=yn(c,dn(e))+"/"+a(t)+i;n(r,{method:"GET",url:u,binary:!0},o)}),u.removeAttachment=o("removeAttachment",function(e,t,r,o){var i=yn(c,dn(e)+"/"+a(t))+"?rev="+r;n({},{method:"DELETE",url:i},o)}),u.putAttachment=o("putAttachment",function(e,t,r,o,i,u){"function"==typeof i&&(u=i,i=o,o=r,r=null);var s=dn(e)+"/"+a(t),f=yn(c,s);if(r&&(f+="?rev="+r),"string"==typeof o){var l;try{l=Uo(o)}catch(e){return u(P(bo,"Attachment is not a valid base64 string"))}o=l?De(l,i):""}var d={headers:{"Content-Type":i},method:"PUT",url:f,processData:!1,body:o,timeout:p.timeout||6e4};n({},d,u)}),u._bulkDocs=function(e,t,r){e.new_edits=t.new_edits,i().then(function(){return to.all(e.docs.map(pn))}).then(function(){n(t,{method:"POST",url:yn(c,"_bulk_docs"),timeout:t.timeout,body:e},function(e,t){return e?r(e):(t.forEach(function(e){e.ok=!0}),void r(null,t))})}).catch(r)},u._put=function(e,t,r){i().then(function(){return pn(e)}).then(function(){n(t,{method:"PUT",url:yn(c,dn(e._id)),body:e},function(e,t){return e?r(e):void r(null,t)})}).catch(r)},u.allDocs=o("allDocs",function(e,t){"function"==typeof e&&(t=e,e={}),e=s(e);var n,o={},i="GET";e.conflicts&&(o.conflicts=!0),e.descending&&(o.descending=!0),e.include_docs&&(o.include_docs=!0),e.attachments&&(o.attachments=!0),e.key&&(o.key=JSON.stringify(e.key)),e.start_key&&(e.startkey=e.start_key),e.startkey&&(o.startkey=JSON.stringify(e.startkey)),e.end_key&&(e.endkey=e.end_key),e.endkey&&(o.endkey=JSON.stringify(e.endkey)),"undefined"!=typeof e.inclusive_end&&(o.inclusive_end=!!e.inclusive_end),"undefined"!=typeof e.limit&&(o.limit=e.limit),"undefined"!=typeof e.skip&&(o.skip=e.skip);var a=gn(o);"undefined"!=typeof e.keys&&(i="POST",n={keys:e.keys}),r(e,{method:i,url:yn(c,"_all_docs"+a),body:n}).then(function(n){e.include_docs&&e.attachments&&e.binary&&n.rows.forEach(ln),t(null,n)}).catch(t)}),u._changes=function(e){var t="batch_size"in e?e.batch_size:Oi;e=s(e),e.timeout="timeout"in e?e.timeout:"timeout"in p?p.timeout:3e4;var r,o=e.timeout?{timeout:e.timeout-5e3}:{},a="undefined"!=typeof e.limit&&e.limit;r="return_docs"in e?e.return_docs:!("returnDocs"in e)||e.returnDocs;var u=a;if(e.style&&(o.style=e.style),(e.include_docs||e.filter&&"function"==typeof e.filter)&&(o.include_docs=!0),e.attachments&&(o.attachments=!0),e.continuous&&(o.feed="longpoll"),e.conflicts&&(o.conflicts=!0),e.descending&&(o.descending=!0),"heartbeat"in e?e.heartbeat&&(o.heartbeat=e.heartbeat):e.continuous&&(o.heartbeat=1e4),e.filter&&"string"==typeof e.filter&&(o.filter=e.filter),e.view&&"string"==typeof e.view&&(o.filter="_view",o.view=e.view),e.query_params&&"object"==typeof e.query_params)for(var f in e.query_params)e.query_params.hasOwnProperty(f)&&(o[f]=e.query_params[f]);var l,d="GET";e.doc_ids&&(o.filter="_doc_ids",d="POST",l={doc_ids:e.doc_ids});var h,v,y=function(r,s){if(!e.aborted){o.since=r,"object"==typeof o.since&&(o.since=JSON.stringify(o.since)),e.descending?a&&(o.limit=u):o.limit=!a||u>t?t:u;var f={method:d,url:yn(c,"_changes"+gn(o)),timeout:e.timeout,body:l};v=r,e.aborted||i().then(function(){h=n(e,f,s)}).catch(s)}},m={results:[]},g=function(n,o){if(!e.aborted){var i=0;if(o&&o.results){i=o.results.length,m.last_seq=o.last_seq;var s={};s.query=e.query_params,o.results=o.results.filter(function(t){u--;var n=q(e)(t);return n&&(e.include_docs&&e.attachments&&e.binary&&ln(t),r&&m.results.push(t),e.onChange(t)),n})}else if(n)return e.aborted=!0,void e.complete(n);o&&o.last_seq&&(v=o.last_seq);var c=a&&u<=0||o&&i<t||e.descending;(!e.continuous||a&&u<=0)&&c?e.complete(null,m):$r(function(){y(v,g)})}};return y(e.since||0,g),{cancel:function(){e.aborted=!0,h&&h.abort()}}},u.revsDiff=o("revsDiff",function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,{method:"POST",url:yn(c,"_revs_diff"),body:e},r)}),u._close=function(e){e()},u._destroy=function(e,t){n(e,{url:yn(c,""),method:"DELETE"},function(e,n){return e&&e.status&&404!==e.status?t(e):void t(null,n)})}}function bn(e,t,n){for(var r="",o=n-e.length;r.length<o;)r+=t;return r}function wn(e,t,n){var r=bn(e,t,n);return r+e}function En(e,t){if(e===t)return 0;e=Sn(e),t=Sn(t);var n=Cn(e),r=Cn(t);if(n-r!==0)return n-r;switch(typeof e){case"number":return e-t;case"boolean":return e<t?-1:1;case"string":return Pn(e,t)}return Array.isArray(e)?Rn(e,t):Tn(e,t)}function Sn(e){switch(typeof e){case"undefined":return null;case"number":return e===1/0||e===-(1/0)||isNaN(e)?null:e;case"object":var t=e;if(Array.isArray(e)){var n=e.length;e=new Array(n);for(var r=0;r<n;r++)e[r]=Sn(t[r])}else{if(e instanceof Date)return e.toJSON();if(null!==e){e={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];"undefined"!=typeof i&&(e[o]=Sn(i))}}}}return e}function On(e){if(null!==e)switch(typeof e){case"boolean":return e?1:0;case"number":return qn(e);case"string":return e.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"");case"object":var t=Array.isArray(e),n=t?e:Object.keys(e),r=-1,o=n.length,i="";if(t)for(;++r<o;)i+=xn(n[r]);else for(;++r<o;){var a=n[r];i+=xn(a)+xn(e[a])}return i}return""}function xn(e){var t="\0";return e=Sn(e),Cn(e)+Ti+On(e)+t}function An(e,t){var n,r=t,o="1"===e[t];if(o)n=0,t++;else{var i="0"===e[t];t++;var a="",u=e.substring(t,t+Pi),s=parseInt(u,10)+Ri;for(i&&(s=-s),t+=Pi;;){var c=e[t];if("\0"===c)break;a+=c,t++}a=a.split("."),n=1===a.length?parseInt(a,10):parseFloat(a[0]+"."+a[1]),i&&(n-=10),0!==s&&(n=parseFloat(n+"e"+s))}return{num:n,length:t-r}}function jn(e,t){var n=e.pop();if(t.length){var r=t[t.length-1];n===r.element&&(t.pop(),r=t[t.length-1]);var o=r.element,i=r.index;if(Array.isArray(o))o.push(n);else if(i===e.length-2){var a=e.pop();o[a]=n}else e.push(n)}}function kn(e){for(var t=[],n=[],r=0;;){var o=e[r++];if("\0"!==o)switch(o){case"1":t.push(null);break;case"2":t.push("1"===e[r]),r++;break;case"3":var i=An(e,r);t.push(i.num),r+=i.length;break;case"4":for(var a="";;){var u=e[r];if("\0"===u)break;a+=u,r++}a=a.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,""),t.push(a);break;case"5":var s={element:[],index:t.length};t.push(s.element),n.push(s);break;case"6":var c={element:{},index:t.length};t.push(c.element),n.push(c);break;default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+o)}else{if(1===t.length)return t.pop();jn(t,n)}}}function Rn(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var o=En(e[r],t[r]);if(0!==o)return o}return e.length===t.length?0:e.length>t.length?1:-1}function Pn(e,t){return e===t?0:e>t?1:-1}function Tn(e,t){for(var n=Object.keys(e),r=Object.keys(t),o=Math.min(n.length,r.length),i=0;i<o;i++){var a=En(n[i],r[i]);if(0!==a)return a;if(a=En(e[n[i]],t[r[i]]),0!==a)return a}return n.length===r.length?0:n.length>r.length?1:-1}function Cn(e){var t=["boolean","number","string","object"],n=t.indexOf(typeof e);return~n?null===e?1:Array.isArray(e)?5:n<3?n+2:n+3:Array.isArray(e)?5:void 0}function qn(e){if(0===e)return"1";var t=e.toExponential().split(/e\+?/),n=parseInt(t[1],10),r=e<0,o=r?"0":"2",i=(r?-n:n)-Ri,a=wn(i.toString(),"0",Pi);o+=Ti+a;var u=Math.abs(parseFloat(t[0]));r&&(u=10-u);var s=u.toFixed(20);return s=s.replace(/\.?0+$/,""),o+=Ti+s}function Ln(){this.promise=new to(function(e){e()})}function Mn(e){var t,n=e.db,r=e.viewName,o=e.map,i=e.reduce,a=e.temporary,u=o.toString()+(i&&i.toString())+"undefined";if(!a&&(t=n._cachedViews=n._cachedViews||{},t[u]))return t[u];var s=n.info().then(function(e){function s(e){e.views=e.views||{};var t=r;t.indexOf("/")===-1&&(t=r+"/"+r);var n=e.views[t]=e.views[t]||{};if(!n[c])return n[c]=!0,e}var c=e.db_name+"-mrview-"+(a?"temp":Qe(u));return F(n,"_local/mrviews",s).then(function(){return n.registerDependentDatabase(c).then(function(e){var r=e.db;r.auto_compaction=!0;var a={name:c,db:r,sourceDB:n,adapter:n.adapter,mapFun:o,reduceFun:i};return a.db.get("_local/lastSeq").catch(function(e){if(404!==e.status)throw e}).then(function(e){return a.seq=e?e.seq:0,t&&a.db.once("destroyed",function(){delete t[u]}),a})})})});return t&&(t[u]=s),s}function In(e){this.status=400,this.name="query_parse_error",this.message=e,this.error=!0;try{Error.captureStackTrace(this,In)}catch(e){}}function Dn(e){this.status=404,this.name="not_found",this.message=e,this.error=!0;try{Error.captureStackTrace(this,Dn)}catch(e){}}function Nn(e){this.status=500,this.name="invalid_value",this.message=e,this.error=!0;try{Error.captureStackTrace(this,Nn)}catch(e){}}function Bn(e){var t="builtin "+e+" function requires map values to be numbers or number arrays";return new Nn(t)}function Un(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];if("number"!=typeof o){if(!Array.isArray(o))throw Bn("_sum");t="number"==typeof t?[t]:t;for(var i=0,a=o.length;i<a;i++){var u=o[i];if("number"!=typeof u)throw Bn("_sum");"undefined"==typeof t[i]?t.push(u):t[i]+=u}}else"number"==typeof t?t+=o:t[0]+=o}return t}function Fn(e,t){return Yr("return ("+e.replace(/;\s*$/,"")+");",{emit:t,sum:Un,log:Ci,isArray:qi,toJSON:Li})}function Hn(e,t){return t&&e.then(function(e){$r(function(){t(null,e)})},function(e){$r(function(){t(e)})}),e}function Wn(e){return Vr(function(t){var n=t.pop(),r=e.apply(this,t);return"function"==typeof n&&Hn(r,n),r})}function Jn(e,t){return e.then(function(e){return t().then(function(){return e})},function(e){return t().then(function(){throw e})})}function Gn(e,t){return function(){var n=arguments,r=this;return e.add(function(){return t.apply(r,n)})}}function Kn(e){var t=new io(e),n=new Array(t.size),r=-1;return t.forEach(function(e){n[++r]=e}),n}function Vn(e){var t=new Array(e.size),n=-1;return e.forEach(function(e,r){t[++n]=r}),t}function zn(e){return e.indexOf("/")===-1?[e,e]:e.split("/")}function Qn(e){return 1===e.length&&/^1-/.test(e[0].rev)}function Xn(e,t){try{e.emit("error",t)}catch(e){x("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."),x("error",t)}}function $n(e,t,n){try{t(n)}catch(t){Xn(e,t)}}function Yn(e,t,n,r,o){try{return{output:t(n,r,o)}}catch(t){return Xn(e,t),{error:t}}}function Zn(e,t){var n=En(e.key,t.key);return 0!==n?n:En(e.value,t.value)}function er(e,t,n){return n=n||0,"number"==typeof t?e.slice(n,t+n):n>0?e.slice(n):e}function tr(e){var t=e.value,n=t&&"object"==typeof t&&t._id||e.id;return n}function nr(e){e.rows.forEach(function(e){var t=e.doc&&e.doc._attachments;t&&Object.keys(t).forEach(function(e){var n=t[e];t[e].data=Ne(n.data,n.content_type)})})}function rr(e){return function(t){return e.include_docs&&e.attachments&&e.binary&&nr(t),t}}function or(e,t,n,r){var o=t[e];"undefined"!=typeof o&&(r&&(o=encodeURIComponent(JSON.stringify(o))),n.push(e+"="+o))}function ir(e){if("undefined"!=typeof e){var t=Number(e);return isNaN(t)||t!==parseInt(e,10)?e:t}}function ar(e){return e.group_level=ir(e.group_level),e.limit=ir(e.limit),e.skip=ir(e.skip),e}function ur(e){if(e){if("number"!=typeof e)return new In('Invalid value for integer: "'+e+'"');if(e<0)return new In('Invalid value for positive integer: "'+e+'"')}}function sr(e,t){var n=e.descending?"endkey":"startkey",r=e.descending?"startkey":"endkey";if("undefined"!=typeof e[n]&&"undefined"!=typeof e[r]&&En(e[n],e[r])>0)throw new In("No rows can match your key range, reverse your start_key and end_key or set {descending : true}");if(t.reduce&&e.reduce!==!1){if(e.include_docs)throw new In("{include_docs:true} is invalid for reduce");if(e.keys&&e.keys.length>1&&!e.group&&!e.group_level)throw new In("Multi-key fetches for reduce views must use {group: true}")}["group_level","limit","skip"].forEach(function(t){var n=ur(e[t]);if(n)throw n})}function cr(e,t,n){var r,o=[],i="GET";if(or("reduce",n,o),or("include_docs",n,o),or("attachments",n,o),or("limit",n,o),or("descending",n,o),or("group",n,o),or("group_level",n,o),or("skip",n,o),or("stale",n,o),or("conflicts",n,o),or("startkey",n,o,!0),or("start_key",n,o,!0),or("endkey",n,o,!0),or("end_key",n,o,!0),or("inclusive_end",n,o),or("key",n,o,!0),o=o.join("&"),o=""===o?"":"?"+o,"undefined"!=typeof n.keys){var a=2e3,u="keys="+encodeURIComponent(JSON.stringify(n.keys));u.length+o.length+1<=a?o+=("?"===o[0]?"&":"?")+u:(i="POST","string"==typeof t?r={keys:n.keys}:t.keys=n.keys)}if("string"==typeof t){var s=zn(t);return e.request({method:i,url:"_design/"+s[0]+"/_view/"+s[1]+o,body:r}).then(rr(n))}return r=r||{},Object.keys(t).forEach(function(e){Array.isArray(t[e])?r[e]=t[e]:r[e]=t[e].toString()}),e.request({method:"POST",url:"_temp_view"+o,body:r}).then(rr(n))}function fr(e,t,n){return new to(function(r,o){e._query(t,n,function(e,t){return e?o(e):void r(t)})})}function lr(e){return new to(function(t,n){e._viewCleanup(function(e,r){return e?n(e):void t(r)})})}function dr(e){return function(t){if(404===t.status)return e;throw t}}function pr(e,t,n){function r(){return Qn(f)?to.resolve(u):t.db.get(a).catch(dr(u))}function o(e){return e.keys.length?t.db.allDocs({keys:e.keys,include_docs:!0}):to.resolve({rows:[]})}function i(e,t){for(var n=[],r=new io,o=0,i=t.rows.length;o<i;o++){var a=t.rows[o],u=a.doc;if(u&&(n.push(u),r.add(u._id),u._deleted=!c.has(u._id),!u._deleted)){var s=c.get(u._id);"value"in s&&(u.value=s.value)}}var f=Vn(c);return f.forEach(function(e){if(!r.has(e)){var t={_id:e},o=c.get(e);"value"in o&&(t.value=o.value),n.push(t)}}),e.keys=Kn(f.concat(e.keys)),n.push(e),n}var a="_local/doc_"+e,u={_id:a,keys:[]},s=n.get(e),c=s[0],f=s[1];return r().then(function(e){return o(e).then(function(t){return i(e,t)})})}function hr(e,t,n){var r="_local/lastSeq";return e.db.get(r).catch(dr({_id:r,seq:0})).then(function(r){var o=Vn(t);return to.all(o.map(function(n){return pr(n,e,t)})).then(function(t){var o=L(t);return r.seq=n,o.push(r),e.db.bulkDocs({docs:o})})})}function vr(e){var t="string"==typeof e?e:e.name,n=Mi[t];return n||(n=Mi[t]=new Ln),n}function yr(e){return Gn(vr(e),function(){return mr(e)})()}function mr(e){function t(e,t){var n={id:s._id,key:Sn(e)};"undefined"!=typeof t&&null!==t&&(n.value=Sn(t)),u.push(n)}function n(t,n){return function(){return hr(e,t,n)}}function r(){return e.sourceDB.changes({conflicts:!0,include_docs:!0,style:"all_docs",since:l,limit:Di}).then(o)}function o(e){var t=e.results;if(t.length){var o=i(t);if(d.add(n(o,l)),!(t.length<Di))return r()}}function i(t){for(var n=new ao,r=0,o=t.length;r<o;r++){var i=t[r];if("_"!==i.doc._id[0]){u=[],s=i.doc,s._deleted||$n(e.sourceDB,c,s),u.sort(Zn);var f=a(u);n.set(i.doc._id,[f,i.changes])}l=i.seq}return n}function a(e){for(var t,n=new ao,r=0,o=e.length;r<o;r++){var i=e[r],a=[i.key,i.id];r>0&&0===En(i.key,t)&&a.push(r),n.set(xn(a),i),t=i.key}return n}var u,s,c;if("function"==typeof e.mapFun&&2===e.mapFun.length){var f=e.mapFun;c=function(e){return f(e,t)}}else c=Fn(e.mapFun.toString(),t);var l=e.seq||0,d=new Ln;return r().then(function(){return d.finish()}).then(function(){e.seq=l})}function gr(e,t,n){0===n.group_level&&delete n.group_level;var r,o=n.group||n.group_level;r=Ni[e.reduceFun]?Ni[e.reduceFun]:Fn(e.reduceFun.toString());var i=[],a=isNaN(n.group_level)?Number.POSITIVE_INFINITY:n.group_level;t.forEach(function(e){var t=i[i.length-1],n=o?e.key:null;return o&&Array.isArray(n)&&(n=n.slice(0,a)),t&&0===En(t.groupKey,n)?(t.keys.push([e.key,e.id]),void t.values.push(e.value)):void i.push({keys:[[e.key,e.id]],values:[e.value],groupKey:n})}),t=[];for(var u=0,s=i.length;u<s;u++){var c=i[u],f=Yn(e.sourceDB,r,c.keys,c.values,!1);if(f.error&&f.error instanceof Nn)throw f.error;t.push({value:f.error?null:f.output,key:c.groupKey})}return{rows:er(t,n.limit,n.skip)}}function _r(e,t){return Gn(vr(e),function(){return br(e,t)})()}function br(e,t){function n(t){return t.include_docs=!0,e.db.allDocs(t).then(function(e){return o=e.total_rows,e.rows.map(function(e){if("value"in e.doc&&"object"==typeof e.doc.value&&null!==e.doc.value){var t=Object.keys(e.doc.value).sort(),n=["id","key","value"];if(!(t<n||t>n))return e.doc.value}var r=kn(e.doc._id);return{key:r[0],id:r[1],value:"value"in e.doc?e.doc.value:null}})})}function r(n){var r;if(r=i?gr(e,n,t):{total_rows:o,offset:a,rows:n},t.include_docs){var u=Kn(n.map(tr));return e.sourceDB.allDocs({keys:u,include_docs:!0,conflicts:t.conflicts,attachments:t.attachments,binary:t.binary}).then(function(e){var t=new ao;return e.rows.forEach(function(e){t.set(e.id,e.doc)}),n.forEach(function(e){var n=tr(e),r=t.get(n);r&&(e.doc=r)}),r})}return r}var o,i=e.reduceFun&&t.reduce!==!1,a=t.skip||0;if("undefined"==typeof t.keys||t.keys.length||(t.limit=0,delete t.keys),"undefined"!=typeof t.keys){var u=t.keys,s=u.map(function(e){var t={startkey:xn([e]),endkey:xn([e,{}])};return n(t)});return to.all(s).then(L).then(r)}var c={descending:t.descending};if(t.start_key&&(t.startkey=t.start_key),t.end_key&&(t.endkey=t.end_key),"undefined"!=typeof t.startkey&&(c.startkey=xn(t.descending?[t.startkey,{}]:[t.startkey])),"undefined"!=typeof t.endkey){var f=t.inclusive_end!==!1;t.descending&&(f=!f),c.endkey=xn(f?[t.endkey,{}]:[t.endkey])}if("undefined"!=typeof t.key){var l=xn([t.key]),d=xn([t.key,{}]);c.descending?(c.endkey=l,c.startkey=d):(c.startkey=l,c.endkey=d)}return i||("number"==typeof t.limit&&(c.limit=t.limit),c.skip=a),n(c).then(r)}function wr(e){return e.request({method:"POST",url:"_view_cleanup"})}function Er(e){return e.get("_local/mrviews").then(function(t){var n=new ao;Object.keys(t.views).forEach(function(e){var t=zn(e),r="_design/"+t[0],o=t[1],i=n.get(r);i||(i=new io,n.set(r,i)),i.add(o)});var r={keys:Vn(n),include_docs:!0};return e.allDocs(r).then(function(r){var o={};r.rows.forEach(function(e){var r=e.key.substring(8);n.get(e.key).forEach(function(n){var i=r+"/"+n;t.views[i]||(i=n);var a=Object.keys(t.views[i]),u=e.doc&&e.doc.views&&e.doc.views[n];a.forEach(function(e){o[e]=o[e]||u})})});var i=Object.keys(o).filter(function(e){return!o[e]}),a=i.map(function(t){return Gn(vr(t),function(){return new e.constructor(t,e.__opts).destroy()})()});return to.all(a).then(function(){return{ok:!0}})})},dr({ok:!0}))}function Sr(e,t,n){if("http"===e.type())return cr(e,t,n);if("function"==typeof e._query)return fr(e,t,n);if("string"!=typeof t){sr(n,t);var r={db:e,viewName:"temp_view/temp_view",map:t.map,reduce:t.reduce,temporary:!0};return Ii.add(function(){return Mn(r).then(function(e){function t(){return e.db.destroy()}return Jn(yr(e).then(function(){return _r(e,n)}),t)})}),Ii.finish()}var o=t,i=zn(o),a=i[0],u=i[1];return e.get("_design/"+a).then(function(t){var r=t.views&&t.views[u];if(!r||"string"!=typeof r.map)throw new Dn("ddoc "+a+" has no view named "+u);sr(n,r);var i={db:e,viewName:o,map:r.map,reduce:r.reduce};return Mn(i).then(function(e){return"ok"===n.stale||"update_after"===n.stale?("update_after"===n.stale&&$r(function(){yr(e)}),_r(e,n)):yr(e).then(function(){return _r(e,n)})})})}function Or(e){return/^1-/.test(e)}function xr(e,t,n){return!e._attachments||!e._attachments[n]||e._attachments[n].digest!==t._attachments[n].digest}function Ar(e,t){var n=Object.keys(t._attachments);return to.all(n.map(function(n){return e.getAttachment(t._id,n,{rev:t._rev})}))}function jr(e,t,n){var r="http"===t.type()&&"http"!==e.type(),o=Object.keys(n._attachments);return r?e.get(n._id).then(function(r){return to.all(o.map(function(o){return xr(r,n,o)?t.getAttachment(n._id,o):e.getAttachment(r._id,o)}))}).catch(function(e){if(404!==e.status)throw e;return Ar(t,n)}):Ar(t,n)}function kr(e){var t=[];return Object.keys(e).forEach(function(n){var r=e[n].missing;r.forEach(function(e){t.push({id:n,rev:e})})}),{docs:t,revs:!0,latest:!0}}function Rr(e,t,n,r){function o(){var o=kr(n);if(o.docs.length)return e.bulkGet(o).then(function(n){if(r.cancelled)throw new Error("cancelled");return to.all(n.results.map(function(n){return to.all(n.docs.map(function(n){var r=n.ok;return n.error&&(d=!1),r&&r._attachments?jr(t,e,r).then(function(e){var t=Object.keys(r._attachments);return e.forEach(function(e,n){var o=r._attachments[t[n]];delete o.stub,delete o.length,o.data=e}),r}):r}))})).then(function(e){l=l.concat(L(e).filter(Boolean))})})}function i(e){return e._attachments&&Object.keys(e._attachments).length>0}function a(e){return e._conflicts&&e._conflicts.length>0}function u(t){return e.allDocs({keys:t,include_docs:!0,conflicts:!0}).then(function(e){if(r.cancelled)throw new Error("cancelled");e.rows.forEach(function(e){e.deleted||!e.doc||!Or(e.value.rev)||i(e.doc)||a(e.doc)||(e.doc._conflicts&&delete e.doc._conflicts,l.push(e.doc),delete n[e.id])})})}function c(){var e=Object.keys(n).filter(function(e){var t=n[e].missing;return 1===t.length&&Or(t[0])});if(e.length>0)return u(e)}function f(){return{ok:d,docs:l}}n=s(n);var l=[],d=!0;return to.resolve().then(c).then(o).then(f)}function Pr(e,t,n,r,o){return e.get(t).catch(function(n){if(404===n.status)return"http"===e.type()&&k(404,"PouchDB is just checking if a remote checkpoint exists."),{session_id:r,_id:t,history:[],replicator:Wi,version:Hi};throw n}).then(function(i){if(!o.cancelled&&i.last_seq!==n)return i.history=(i.history||[]).filter(function(e){return e.session_id!==r}),i.history.unshift({last_seq:n,session_id:r}),i.history=i.history.slice(0,Ji),i.version=Hi,i.replicator=Wi,i.session_id=r,i.last_seq=n,e.put(i).catch(function(i){if(409===i.status)return Pr(e,t,n,r,o);throw i})})}function Tr(e,t,n,r){this.src=e,this.target=t,this.id=n,this.returnValue=r}function Cr(e,t){return e.session_id===t.session_id?{last_seq:e.last_seq,history:e.history}:qr(e.history,t.history)}function qr(e,t){var n=e[0],r=e.slice(1),o=t[0],i=t.slice(1);if(!n||0===t.length)return{last_seq:Gi,history:[]};var a=n.session_id;if(Lr(a,t))return{last_seq:n.last_seq,history:e};var u=o.session_id;return Lr(u,r)?{last_seq:o.last_seq,history:i}:qr(r,i)}function Lr(e,t){var n=t[0],r=t.slice(1);return!(!e||0===t.length)&&(e===n.session_id||Lr(e,r))}function Mr(e){return"number"==typeof e.status&&4===Math.floor(e.status/100)}function Ir(e,t,n,r){if(e.retry===!1)return t.emit("error",n),void t.removeAllListeners();if("function"!=typeof e.back_off_function&&(e.back_off_function=j),t.emit("requestError",n),"active"===t.state||"pending"===t.state){t.emit("paused",n),t.state="stopped";var o=function(){e.current_back_off=Vi},i=function(){t.removeListener("active",o)};t.once("paused",i),t.once("active",o)}e.current_back_off=e.current_back_off||Vi,e.current_back_off=e.back_off_function(e.current_back_off),setTimeout(r,e.current_back_off)}function Dr(e){return Object.keys(e).sort(En).reduce(function(t,n){return t[n]=e[n],t},{})}function Nr(e,t,n){var r=n.doc_ids?n.doc_ids.sort(En):"",o=n.filter?n.filter.toString():"",i="",a="";return n.filter&&n.query_params&&(i=JSON.stringify(Dr(n.query_params))),n.filter&&"_view"===n.filter&&(a=n.view.toString()),to.all([e.id(),t.id()]).then(function(e){var t=e[0]+e[1]+o+a+i+r;return new to(function(e){ze(t,e)})}).then(function(e){return e=e.replace(/\//g,".").replace(/\+/g,"_"),"_local/"+e})}function Br(e,t,n,r,o){function i(){return S?to.resolve():Nr(e,t,n).then(function(n){E=n,S=new Tr(e,t,E,r)})}function a(){if(I=[],0!==w.docs.length){var e=w.docs,i={timeout:n.timeout};return t.bulkDocs({docs:e,new_edits:!1},i).then(function(t){
if(r.cancelled)throw h(),new Error("cancelled");var n=Object.create(null);t.forEach(function(e){e.error&&(n[e.id]=e)});var i=Object.keys(n).length;o.doc_write_failures+=i,o.docs_written+=e.length-i,e.forEach(function(e){var t=n[e._id];if(t){if(o.errors.push(t),"unauthorized"!==t.name&&"forbidden"!==t.name)throw t;r.emit("denied",s(t))}else I.push(e)})},function(t){throw o.doc_write_failures+=e.length,t})}}function u(){if(w.error)throw new Error("There was a problem getting docs.");o.last_seq=R=w.seq;var e=s(o);return I.length&&(e.docs=I,r.emit("change",e)),A=!0,S.writeCheckpoint(w.seq,D).then(function(){if(A=!1,r.cancelled)throw h(),new Error("cancelled");w=void 0,g()}).catch(function(e){throw b(e),e})}function c(){var e={};return w.changes.forEach(function(t){"_user/"!==t.id&&(e[t.id]=t.changes.map(function(e){return e.rev}))}),t.revsDiff(e).then(function(e){if(r.cancelled)throw h(),new Error("cancelled");w.diffs=e})}function f(){return Rr(e,t,w.diffs,r).then(function(e){w.error=!e.ok,e.docs.forEach(function(e){delete w.diffs[e._id],o.docs_read++,w.docs.push(e)})})}function l(){if(!r.cancelled&&!w){if(0===O.length)return void d(!0);w=O.shift(),c().then(f).then(a).then(u).then(l).catch(function(e){p("batch processing terminated with error",e)})}}function d(e){return 0===x.changes.length?void(0!==O.length||w||((P&&N.live||j)&&(r.state="pending",r.emit("paused")),j&&h())):void((e||j||x.changes.length>=T)&&(O.push(x),x={seq:0,changes:[],docs:[]},"pending"!==r.state&&"stopped"!==r.state||(r.state="active",r.emit("active")),l()))}function p(e,t){k||(t.message||(t.message=e),o.ok=!1,o.status="aborting",O=[],x={seq:0,changes:[],docs:[]},h(t))}function h(i){k||r.cancelled&&(o.status="cancelled",A)||(o.status=o.status||"complete",o.end_time=new Date,o.last_seq=R,k=!0,i?(i.result=o,"unauthorized"===i.name||"forbidden"===i.name?(r.emit("error",i),r.removeAllListeners()):Ir(n,r,i,function(){Br(e,t,n,r)})):(r.emit("complete",o),r.removeAllListeners()))}function v(e){if(r.cancelled)return h();var t=q(n)(e);t&&(x.seq=e.seq,x.changes.push(e),d(0===O.length&&N.live))}function y(e){if(L=!1,r.cancelled)return h();if(e.results.length>0)N.since=e.last_seq,g(),d(!0);else{var t=function(){P?(N.live=!0,g()):j=!0,d(!0)};w||0!==e.results.length?t():(A=!0,S.writeCheckpoint(e.last_seq,D).then(function(){A=!1,o.last_seq=R=e.last_seq,t()}).catch(b))}}function m(e){return L=!1,r.cancelled?h():void p("changes rejected",e)}function g(){function t(){i.cancel()}function o(){r.removeListener("cancel",t)}if(!L&&!j&&O.length<C){L=!0,r._changes&&(r.removeListener("cancel",r._abortChanges),r._changes.cancel()),r.once("cancel",t);var i=e.changes(N).on("change",v);i.then(o,o),i.then(y).catch(m),n.retry&&(r._changes=i,r._abortChanges=t)}}function _(){i().then(function(){return r.cancelled?void h():S.getCheckpoint().then(function(e){R=e,N={since:R,limit:T,batch_size:T,style:"all_docs",doc_ids:M,return_docs:!0},n.filter&&("string"!=typeof n.filter?N.include_docs=!0:N.filter=n.filter),"heartbeat"in n&&(N.heartbeat=n.heartbeat),"timeout"in n&&(N.timeout=n.timeout),n.query_params&&(N.query_params=n.query_params),n.view&&(N.view=n.view),g()})}).catch(function(e){p("getCheckpoint rejected with ",e)})}function b(e){A=!1,p("writeCheckpoint completed with error",e)}var w,E,S,O=[],x={seq:0,changes:[],docs:[]},A=!1,j=!1,k=!1,R=0,P=n.continuous||n.live||!1,T=n.batch_size||100,C=n.batches_limit||10,L=!1,M=n.doc_ids,I=[],D=J();o=o||{ok:!0,start_time:new Date,docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};var N={};return r.ready(e,t),r.cancelled?void h():(r._addedListeners||(r.once("cancel",h),"function"==typeof n.complete&&(r.once("error",n.complete),r.once("complete",function(e){n.complete(null,e)})),r._addedListeners=!0),void("undefined"==typeof n.since?_():i().then(function(){return A=!0,S.writeCheckpoint(n.since,D)}).then(function(){return A=!1,r.cancelled?void h():(R=n.since,void _())}).catch(b)))}function Ur(){Qr.EventEmitter.call(this),this.cancelled=!1,this.state="pending";var e=this,t=new to(function(t,n){e.once("complete",t),e.once("error",n)});e.then=function(e,n){return t.then(e,n)},e.catch=function(e){return t.catch(e)},e.catch(function(){})}function Fr(e,t){var n=t.PouchConstructor;return"string"==typeof e?new n(e,t):e}function Hr(e,t,n,r){if("function"==typeof n&&(r=n,n={}),"undefined"==typeof n&&(n={}),n.doc_ids&&!Array.isArray(n.doc_ids))throw P(So,"`doc_ids` filter parameter is not a list.");n.complete=r,n=s(n),n.continuous=n.continuous||n.live,n.retry="retry"in n&&n.retry,n.PouchConstructor=n.PouchConstructor||this;var o=new Ur(n),i=Fr(e,n),a=Fr(t,n);return Br(i,a,n,o),o}function Wr(e,t,n,r){return"function"==typeof n&&(r=n,n={}),"undefined"==typeof n&&(n={}),n=s(n),n.PouchConstructor=n.PouchConstructor||this,e=Fr(e,n),t=Fr(t,n),new Jr(e,t,n,r)}function Jr(e,t,n,r){function o(e){h.emit("change",{direction:"pull",change:e})}function i(e){h.emit("change",{direction:"push",change:e})}function a(e){h.emit("denied",{direction:"push",doc:e})}function u(e){h.emit("denied",{direction:"pull",doc:e})}function s(){h.pushPaused=!0,h.pullPaused&&h.emit("paused")}function c(){h.pullPaused=!0,h.pushPaused&&h.emit("paused")}function f(){h.pushPaused=!1,h.pullPaused&&h.emit("active",{direction:"push"})}function l(){h.pullPaused=!1,h.pushPaused&&h.emit("active",{direction:"pull"})}function d(e){return function(t,n){var r="change"===t&&(n===o||n===i),d="denied"===t&&(n===u||n===a),p="paused"===t&&(n===c||n===s),v="active"===t&&(n===l||n===f);(r||d||p||v)&&(t in m||(m[t]={}),m[t][e]=!0,2===Object.keys(m[t]).length&&h.removeAllListeners(t))}}function p(e,t,n){e.listeners(t).indexOf(n)==-1&&e.on(t,n)}var h=this;this.canceled=!1;var v=n.push?fo({},n,n.push):n,y=n.pull?fo({},n,n.pull):n;this.push=Hr(e,t,v),this.pull=Hr(t,e,y),this.pushPaused=!0,this.pullPaused=!0;var m={};n.live&&(this.push.on("complete",h.pull.cancel.bind(h.pull)),this.pull.on("complete",h.push.cancel.bind(h.push))),this.on("newListener",function(e){"change"===e?(p(h.pull,"change",o),p(h.push,"change",i)):"denied"===e?(p(h.pull,"denied",u),p(h.push,"denied",a)):"active"===e?(p(h.pull,"active",l),p(h.push,"active",f)):"paused"===e&&(p(h.pull,"paused",c),p(h.push,"paused",s))}),this.on("removeListener",function(e){"change"===e?(h.pull.removeListener("change",o),h.push.removeListener("change",i)):"denied"===e?(h.pull.removeListener("denied",u),h.push.removeListener("denied",a)):"active"===e?(h.pull.removeListener("active",l),h.push.removeListener("active",f)):"paused"===e&&(h.pull.removeListener("paused",c),h.push.removeListener("paused",s))}),this.pull.on("removeListener",d("pull")),this.push.on("removeListener",d("push"));var g=to.all([this.push,this.pull]).then(function(e){var t={push:e[0],pull:e[1]};return h.emit("complete",t),r&&r(null,t),h.removeAllListeners(),t},function(e){if(h.cancel(),r?r(e):h.emit("error",e),h.removeAllListeners(),r)throw e});this.then=function(e,t){return g.then(e,t)},this.catch=function(e){return g.catch(e)}}function Gr(e){e.replicate=Hr,e.sync=Wr,Object.defineProperty(e.prototype,"replicate",{get:function(){var e=this;return{from:function(t,n,r){return e.constructor.replicate(t,e,n,r)},to:function(t,n,r){return e.constructor.replicate(e,t,n,r)}}}}),e.prototype.sync=function(e,t,n){return this.constructor.sync(this,e,t,n)}}var Kr=r(n(76)),Vr=r(n(62)),zr=r(n(65)),Qr=n(67),Xr=r(n(74)),$r=r(n(35)),Yr=r(n(116)),Zr=r(n(117)),eo=r(n(122)),to="function"==typeof Promise?Promise:Kr,no=Function.prototype.toString,ro=no.call(Object),oo=zr("pouchdb:api");v.prototype.get=function(e){var t=p(e);return this._store[t]},v.prototype.set=function(e,t){var n=p(e);return this._store[n]=t,!0},v.prototype.has=function(e){var t=p(e);return t in this._store},v.prototype.delete=function(e){var t=p(e),n=t in this._store;return delete this._store[t],n},v.prototype.forEach=function(e){for(var t=Object.keys(this._store),n=0,r=t.length;n<r;n++){var o=t[n],i=this._store[o];o=h(o),e(i,o)}},Object.defineProperty(v.prototype,"size",{get:function(){return Object.keys(this._store).length}}),y.prototype.add=function(e){return this._store.set(e,!0)},y.prototype.has=function(e){return this._store.has(e)},y.prototype.forEach=function(e){this._store.forEach(function(t,n){e(n)})},Object.defineProperty(y.prototype,"size",{get:function(){return this._store.size}});var io,ao;m()?(io=Set,ao=Map):(io=y,ao=v);var uo,so=6;if(w())uo=!1;else try{localStorage.setItem("_pouch_check_localstorage",1),uo=!!localStorage.getItem("_pouch_check_localstorage")}catch(e){uo=!1}Xr(O,Qr.EventEmitter),O.prototype.addListener=function(e,t,n,r){function o(){function e(){a=!1}if(i._listeners[t]){if(a)return void(a="waiting");a=!0;var u=d(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary"]);n.changes(u).on("change",function(e){e.seq>r.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))}).on("complete",function(){"waiting"===a&&$r(o),a=!1}).on("error",e)}}if(!this._listeners[t]){var i=this,a=!1;this._listeners[t]=o,this.on(e,o)}},O.prototype.removeListener=function(e,t){t in this._listeners&&(Qr.EventEmitter.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},O.prototype.notifyLocalWindows=function(e){w()?chrome.storage.local.set({dbName:e}):E()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},O.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)};var co;co="function"==typeof Object.assign?Object.assign:function(e){for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};var fo=co;Xr(R,Error),R.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})};var lo,po=(new R(401,"unauthorized","Name or password is incorrect."),new R(400,"bad_request","Missing JSON list of 'docs'")),ho=new R(404,"not_found","missing"),vo=new R(409,"conflict","Document update conflict"),yo=new R(400,"bad_request","_id field must contain a string"),mo=new R(412,"missing_id","_id is required for puts"),go=new R(400,"bad_request","Only reserved document ids may start with underscore."),_o=(new R(412,"precondition_failed","Database not open"),new R(500,"unknown_error","Database encountered an unknown error")),bo=new R(500,"badarg","Some query argument is invalid"),wo=(new R(400,"invalid_request","Request was invalid"),new R(400,"query_parse_error","Some query parameter is invalid")),Eo=new R(500,"doc_validation","Bad special document member"),So=new R(400,"bad_request","Something wrong with the request"),Oo=new R(400,"bad_request","Document must be a JSON object"),xo=(new R(404,"not_found","Database not found"),new R(500,"indexed_db_went_bad","unknown")),Ao=new R(500,"web_sql_went_bad","unknown"),jo=(new R(500,"levelDB_went_went_bad","unknown"),new R(403,"forbidden","Forbidden by design doc validate_doc_update function"),new R(400,"bad_request","Invalid rev format")),ko=(new R(412,"file_exists","The database could not be created, the file already exists."),new R(412,"missing_stub","A pre-existing attachment stub wasn't found")),Ro=(new R(413,"invalid_url","Provided URL is invalid"),M.name);lo=Ro?function(e){return e.name}:function(e){return e.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]};var Po=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],To="queryKey",Co=/(?:^|&)([^&=]*)=?([^&]*)/g,qo=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Lo="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");Xr(ve,Qr.EventEmitter),ve.prototype.cancel=function(){this.isCancelled=!0,this.db.taskqueue.isReady&&this.emit("cancel")},ve.prototype.doChanges=function(e){var t=this,n=e.complete;if(e=s(e),"live"in e&&!("continuous"in e)&&(e.continuous=e.live),e.processChange=ye,"latest"===e.since&&(e.since="now"),e.since||(e.since=0),"now"===e.since)return void this.db.info().then(function(r){return t.isCancelled?void n(null,{status:"cancelled"}):(e.since=r.update_seq,void t.doChanges(e))},n);if(e.view&&!e.filter&&(e.filter="_view"),e.filter&&"string"==typeof e.filter&&("_view"===e.filter?e.view=B(e.view):e.filter=B(e.filter),"http"!==this.db.type()&&!e.doc_ids))return this.filterChanges(e);"descending"in e||(e.descending=!1),e.limit=0===e.limit?1:e.limit,e.complete=n;var r=this.db._changes(e);if(r&&"function"==typeof r.cancel){var o=t.cancel;t.cancel=Vr(function(e){r.cancel(),o.apply(this,e)})}},ve.prototype.filterChanges=function(e){var t=this,n=e.complete;if("_view"===e.filter){if(!e.view||"string"!=typeof e.view){var r=P(So,"`view` filter parameter not found or invalid.");return n(r)}var o=N(e.view);this.db.get("_design/"+o[0],function(r,i){if(t.isCancelled)return n(null,{status:"cancelled"});if(r)return n(T(r));var a=i&&i.views&&i.views[o[1]]&&i.views[o[1]].map;return a?(e.filter=pe(a),void t.doChanges(e)):n(P(ho,i.views?"missing json key: "+o[1]:"missing json key: views"))})}else{var i=N(e.filter);if(!i)return t.doChanges(e);this.db.get("_design/"+i[0],function(r,o){if(t.isCancelled)return n(null,{status:"cancelled"});if(r)return n(T(r));var a=o&&o.filters&&o.filters[i[1]];return a?(e.filter=de(a),void t.doChanges(e)):n(P(ho,o&&o.filters?"missing json key: "+i[1]:"missing json key: filters"))})}},Xr(xe,Qr.EventEmitter),xe.prototype.post=l("post",function(e,t,n){return"function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e)?n(P(Oo)):void this.bulkDocs({docs:[e]},t,ge(n))}),xe.prototype.put=l("put",function(e,t,n){return"function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e)?n(P(Oo)):(I(e._id),fe(e._id)&&"function"==typeof this._putLocal?e._deleted?this._removeLocal(e,n):this._putLocal(e,n):void("function"==typeof this._put&&t.new_edits!==!1?this._put(e,t,n):this.bulkDocs({docs:[e]},t,ge(n))))}),xe.prototype.putAttachment=l("putAttachment",function(e,t,n,r,o){function i(e){var n="_rev"in e?parseInt(e._rev,10):0;return e._attachments=e._attachments||{},e._attachments[t]={content_type:o,data:r,revpos:++n},a.put(e)}var a=this;return"function"==typeof o&&(o=r,r=n,n=null),"undefined"==typeof o&&(o=r,r=n,n=null),o||x("warn","Attachment",t,"on document",e,"is missing content_type"),a.get(e).then(function(e){if(e._rev!==n)throw P(vo);return i(e)},function(t){if(t.reason===ho.message)return i({_id:e});throw t})}),xe.prototype.removeAttachment=l("removeAttachment",function(e,t,n,r){var o=this;o.get(e,function(e,i){return e?void r(e):i._rev!==n?void r(P(vo)):i._attachments?(delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,void o.put(i,r)):r()})}),xe.prototype.remove=l("remove",function(e,t,n,r){var o;"string"==typeof t?(o={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(o=e,"function"==typeof t?(r=t,n={}):(r=n,n=t)),n=n||{},n.was_delete=!0;var i={_id:o._id,_rev:o._rev||n.rev};return i._deleted=!0,fe(i._id)&&"function"==typeof this._removeLocal?this._removeLocal(o,r):void this.bulkDocs({docs:[i]},n,ge(r))}),xe.prototype.revsDiff=l("revsDiff",function(e,t,n){function r(e,t){u.has(e)||u.set(e,{missing:[]}),u.get(e).missing.push(t)}function o(t,n){var o=e[t].slice(0);K(n,function(e,n,i,a,u){var s=n+"-"+i,c=o.indexOf(s);c!==-1&&(o.splice(c,1),"available"!==u.status&&r(t,s))}),o.forEach(function(e){r(t,e)})}"function"==typeof t&&(n=t,t={});var i=Object.keys(e);if(!i.length)return n(null,{});var a=0,u=new ao;i.map(function(t){this._getRevisionTree(t,function(r,s){if(r&&404===r.status&&"missing"===r.message)u.set(t,{missing:e[t]});else{if(r)return n(r);o(t,s)}if(++a===i.length){var c={};return u.forEach(function(e,t){c[t]=e}),n(null,c)}})},this)}),xe.prototype.bulkGet=l("bulkGet",function(e,t){b(this,e,t)}),xe.prototype.compactDocument=l("compactDocument",function(e,t,n){var r=this;this._getRevisionTree(e,function(o,i){if(o)return n(o);var a=we(i),u=[],s=[];Object.keys(a).forEach(function(e){a[e]>t&&u.push(e)}),K(i,function(e,t,n,r,o){var i=t+"-"+n;"available"===o.status&&u.indexOf(i)!==-1&&s.push(i)}),r._doCompaction(e,s,n)})}),xe.prototype.compact=l("compact",function(e,t){"function"==typeof e&&(t=e,e={});var n=this;e=e||{},n._compactionQueue=n._compactionQueue||[],n._compactionQueue.push({opts:e,callback:t}),1===n._compactionQueue.length&&Se(n)}),xe.prototype._compact=function(e,t){function n(e){a.push(o.compactDocument(e.id,0))}function r(e){var n=e.last_seq;to.all(a).then(function(){return F(o,"_local/compaction",function(e){return(!e.last_seq||e.last_seq<n)&&(e.last_seq=n,e)})}).then(function(){t(null,{ok:!0})}).catch(t)}var o=this,i={return_docs:!1,last_seq:e.last_seq||0},a=[];o.changes(i).on("change",n).on("complete",r).on("error",t)},xe.prototype.get=l("get",function(e,t,n){function r(){var r=[],a=o.length;return a?void o.forEach(function(o){i.get(e,{rev:o,revs:t.revs,latest:t.latest,attachments:t.attachments},function(e,t){if(e)r.push({missing:o});else{for(var i,u=0,s=r.length;u<s;u++)if(r[u].ok&&r[u].ok._rev===t._rev){i=!0;break}i||r.push({ok:t})}a--,a||n(null,r)})}):n(null,r)}if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(P(yo));if(fe(e)&&"function"==typeof this._getLocal)return this._getLocal(e,n);var o=[],i=this;if(!t.open_revs)return this._get(e,t,function(e,r){if(e)return n(e);var o=r.doc,a=r.metadata,u=r.ctx;if(t.conflicts){var s=Q(a);s.length&&(o._conflicts=s)}if(ce(a,o._rev)&&(o._deleted=!0),t.revs||t.revs_info){for(var c=o._rev.split("-"),f=parseInt(c[0],10),l=c[1],d=$(a.rev_tree),p=null,h=0;h<d.length;h++){var v=d[h],y=v.ids.map(function(e){return e.id}).indexOf(l),m=y===f-1;(m||!p&&y!==-1)&&(p=v)}var g=p.ids.map(function(e){return e.id}).indexOf(o._rev.split("-")[1])+1,_=p.ids.length-g;if(p.ids.splice(g,_),p.ids.reverse(),t.revs&&(o._revisions={start:p.pos+p.ids.length-1,ids:p.ids.map(function(e){return e.id})}),t.revs_info){var b=p.pos+p.ids.length;o._revs_info=p.ids.map(function(e){return b--,{rev:b+"-"+e.id,status:e.opts.status}})}}if(t.attachments&&o._attachments){var w=o._attachments,E=Object.keys(w).length;if(0===E)return n(null,o);Object.keys(w).forEach(function(e){this._getAttachment(o._id,e,w[e],{rev:o._rev,binary:t.binary,ctx:u},function(t,r){var i=o._attachments[e];i.data=r,delete i.stub,delete i.length,--E||n(null,o)})},i)}else{if(o._attachments)for(var S in o._attachments)o._attachments.hasOwnProperty(S)&&(o._attachments[S].stub=!0);n(null,o)}});if("all"===t.open_revs)this._getRevisionTree(e,function(e,t){return e?n(e):(o=z(t).map(function(e){return e.rev}),void r())});else{if(!Array.isArray(t.open_revs))return n(P(_o,"function_clause"));o=t.open_revs;for(var a=0;a<o.length;a++){var u=o[a];if("string"!=typeof u||!/^\d+-/.test(u))return n(P(jo))}r()}}),xe.prototype.getAttachment=l("getAttachment",function(e,t,n,r){var o=this;n instanceof Function&&(r=n,n={}),this._get(e,n,function(i,a){return i?r(i):a.doc._attachments&&a.doc._attachments[t]?(n.ctx=a.ctx,n.binary=!0,o._getAttachment(e,t,a.doc._attachments[t],n,r),void 0):r(P(ho))})}),xe.prototype.allDocs=l("allDocs",function(e,t){if("function"==typeof e&&(t=e,e={}),e.skip="undefined"!=typeof e.skip?e.skip:0,e.start_key&&(e.startkey=e.start_key),e.end_key&&(e.endkey=e.end_key),"keys"in e){if(!Array.isArray(e.keys))return t(new TypeError("options.keys must be an array"));var n=["startkey","endkey","key"].filter(function(t){return t in e})[0];if(n)return void t(P(wo,"Query parameter `"+n+"` is not compatible with multi-get"));if("http"!==this.type())return Ee(this,e,t)}return this._allDocs(e,t)}),xe.prototype.changes=function(e,t){return"function"==typeof e&&(t=e,e={}),new ve(this,e,t)},xe.prototype.close=l("close",function(e){return this._closed=!0,this.emit("closed"),this._close(e)}),xe.prototype.info=l("info",function(e){var t=this;this._info(function(n,r){return n?e(n):(r.db_name=r.db_name||t.name,r.auto_compaction=!(!t.auto_compaction||"http"===t.type()),r.adapter=t.type(),void e(null,r))})}),xe.prototype.id=l("id",function(e){return this._id(e)}),xe.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},xe.prototype.bulkDocs=l("bulkDocs",function(e,t,n){if("function"==typeof t&&(n=t,t={}),t=t||{},Array.isArray(e)&&(e={docs:e}),!e||!e.docs||!Array.isArray(e.docs))return n(P(po));for(var r=0;r<e.docs.length;++r)if("object"!=typeof e.docs[r]||Array.isArray(e.docs[r]))return n(P(Oo));var o;if(e.docs.forEach(function(e){e._attachments&&Object.keys(e._attachments).forEach(function(t){o=o||Oe(t),e._attachments[t].content_type||x("warn","Attachment",t,"on document",e._id,"is missing content_type")})}),o)return n(P(So,o));"new_edits"in t||("new_edits"in e?t.new_edits=e.new_edits:t.new_edits=!0);var i=this;t.new_edits||"http"===i.type()||e.docs.sort(be),_e(e.docs);var a=e.docs.map(function(e){return e._id});return this._bulkDocs(e,t,function(e,r){if(e)return n(e);if(t.new_edits||(r=r.filter(function(e){return e.error})),"http"!==i.type())for(var o=0,u=r.length;o<u;o++)r[o].id=r[o].id||a[o];n(null,r)})}),xe.prototype.registerDependentDatabase=l("registerDependentDatabase",function(e,t){function n(t){return t.dependentDbs=t.dependentDbs||{},!t.dependentDbs[e]&&(t.dependentDbs[e]=!0,t)}var r=new this.constructor(e,this.__opts);F(this,"_local/_pouch_dependentDbs",n).then(function(){t(null,{db:r})}).catch(t)}),xe.prototype.destroy=l("destroy",function(e,t){function n(){r._destroy(e,function(e,n){return e?t(e):(r._destroyed=!0,r.emit("destroyed"),void t(null,n||{ok:!0}))})}"function"==typeof e&&(t=e,e={});var r=this,o=!("use_prefix"in r)||r.use_prefix;return"http"===r.type()?n():void r.get("_local/_pouch_dependentDbs",function(e,i){if(e)return 404!==e.status?t(e):n();var a=i.dependentDbs,u=r.constructor,s=Object.keys(a).map(function(e){var t=o?e.replace(new RegExp("^"+u.prefix),""):e;return new u(t,r.__opts).destroy()});to.all(s).then(n,t)})}),Ae.prototype.execute=function(){var e;if(this.failed)for(;e=this.queue.shift();)e(this.failed);else for(;e=this.queue.shift();)e()},Ae.prototype.fail=function(e){this.failed=e,this.execute()},Ae.prototype.ready=function(e){this.isReady=!0,this.db=e,this.execute()},Ae.prototype.addTask=function(e){this.queue.push(e),this.failed&&this.execute()},Xr(Re,xe),Re.debug=zr,Re.adapters={},Re.preferredAdapters=[],Re.prefix="_pouch_";var Mo=new Qr.EventEmitter;Pe(Re),Re.adapter=function(e,t,n){t.valid()&&(Re.adapters[e]=t,n&&Re.preferredAdapters.push(e))},Re.plugin=function(e){if("function"==typeof e)e(Re);else{if("object"!=typeof e||0===Object.keys(e).length)throw new Error('Invalid plugin: got "'+e+'", expected an object or a function');Object.keys(e).forEach(function(t){Re.prototype[t]=e[t]})}return Re},Re.defaults=function(e){function t(e,n){return this instanceof t?(n=n||{},e&&"object"==typeof e&&(n=e,e=n.name,delete n.name),n=fo({},t.__defaults,n),void Re.call(this,e,n)):new t(e,n)}return Xr(t,Re),t.preferredAdapters=Re.preferredAdapters.slice(),Object.keys(Re).forEach(function(e){e in t||(t[e]=Re[e])}),t.__defaults=fo({},this.__defaults,e),t};var Io="6.1.1";Re.version=Io;var Do,No=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"]),Bo=Te(["_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]),Uo=function(e){return atob(e)},Fo=function(e){return btoa(e)},Ho=t.setImmediate||t.setTimeout,Wo=32768,Jo=5,Go="document-store",Ko="by-sequence",Vo="attach-store",zo="attach-seq-store",Qo="meta-store",Xo="local-store",$o="detect-blob-support",Yo=new O,Zo=!1,ei=[],ti=new ao,ni=new ao;At.valid=function(){var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform);return!e&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange};var ri=function(e){e.adapter("idb",At,!0)},oi=7,ii=Lt("document-store"),ai=Lt("by-sequence"),ui=Lt("attach-store"),si=Lt("local-store"),ci=Lt("metadata-store"),fi=Lt("attach-seq-store"),li=new ao,di=new O,pi=1,hi="CREATE INDEX IF NOT EXISTS 'by-seq-deleted-idx' ON "+ai+" (seq, deleted)",vi="CREATE UNIQUE INDEX IF NOT EXISTS 'by-seq-doc-id-rev' ON "+ai+" (doc_id, rev)",yi="CREATE INDEX IF NOT EXISTS 'doc-winningseq-idx' ON "+ii+" (winningseq)",mi="CREATE INDEX IF NOT EXISTS 'attach-seq-seq-idx' ON "+fi+" (seq)",gi="CREATE UNIQUE INDEX IF NOT EXISTS 'attach-seq-digest-idx' ON "+fi+" (digest, seq)",_i=ai+".seq = "+ii+".winningseq",bi=ai+".seq AS seq, "+ai+".deleted AS deleted, "+ai+".json AS data, "+ai+".rev AS rev, "+ii+".json AS metadata";en.valid=Yt,en.use_prefix=!0;var wi=function(e){e.adapter("websql",en,!0)},Ei=on(),Si=function(){},Oi=25,xi=50,Ai={},ji=zr("pouchdb:http");_n.valid=function(){return!0};var ki=function(e){e.adapter("http",_n,!1),e.adapter("https",_n,!1)},Ri=-324,Pi=3,Ti="";Ln.prototype.add=function(e){return this.promise=this.promise.catch(function(){}).then(function(){return e()}),this.promise},Ln.prototype.finish=function(){return this.promise},Xr(In,Error),Xr(Dn,Error),Xr(Nn,Error);var Ci=x.bind(null,"log"),qi=Array.isArray,Li=JSON.parse,Mi={},Ii=new Ln,Di=50,Ni={_sum:function(e,t){return Un(t)},_count:function(e,t){return t.length},_stats:function(e,t){function n(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];t+=o*o}return t}return{sum:Un(t),min:Math.min.apply(null,t),max:Math.max.apply(null,t),count:t.length,sumsqr:n(t)}}},Bi=Wn(function(){var e=this;return"http"===e.type()?wr(e):"function"==typeof e._viewCleanup?lr(e):Er(e)}),Ui=function(e,t,n){"function"==typeof t&&(n=t,t={}),t=t?ar(t):{},"function"==typeof e&&(e={map:e});var r=this,o=to.resolve().then(function(){return Sr(r,e,t)});return Hn(o,n),o},Fi={query:Ui,viewCleanup:Bi},Hi=1,Wi="pouchdb",Ji=5,Gi=0;Tr.prototype.writeCheckpoint=function(e,t){var n=this;return this.updateTarget(e,t).then(function(){return n.updateSource(e,t)})},Tr.prototype.updateTarget=function(e,t){return Pr(this.target,this.id,e,t,this.returnValue)},Tr.prototype.updateSource=function(e,t){var n=this;return this.readOnlySource?to.resolve(!0):Pr(this.src,this.id,e,t,this.returnValue).catch(function(e){if(Mr(e))return n.readOnlySource=!0,!0;throw e})};var Ki={undefined:function(e,t){return 0===En(e.last_seq,t.last_seq)?t.last_seq:0},1:function(e,t){return Cr(t,e).last_seq}};Tr.prototype.getCheckpoint=function(){var e=this;return e.target.get(e.id).then(function(t){return e.readOnlySource?to.resolve(t.last_seq):e.src.get(e.id).then(function(e){if(t.version!==e.version)return Gi;var n;return n=t.version?t.version.toString():"undefined",n in Ki?Ki[n](t,e):Gi},function(n){if(404===n.status&&t.last_seq)return e.src.put({_id:e.id,last_seq:Gi}).then(function(){return Gi},function(n){return Mr(n)?(e.readOnlySource=!0,t.last_seq):Gi});throw n})}).catch(function(e){if(404!==e.status)throw e;return Gi})};var Vi=0;Xr(Ur,Qr.EventEmitter),Ur.prototype.cancel=function(){this.cancelled=!0,this.state="cancelled",this.emit("cancel")},Ur.prototype.ready=function(e,t){function n(){o.cancel()}function r(){e.removeListener("destroyed",n),t.removeListener("destroyed",n)}var o=this;o._readyCalled||(o._readyCalled=!0,e.once("destroyed",n),t.once("destroyed",n),o.once("complete",r))},Xr(Jr,Qr.EventEmitter),Jr.prototype.cancel=function(){this.canceled||(this.canceled=!0,this.push.cancel(),this.pull.cancel())},Re.plugin(ri).plugin(wi).plugin(ki).plugin(Fi).plugin(Gr),e.exports=Re}).call(t,n(5))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.default=void 0;var u=n(0),s=n(43),c=r(s),f=n(44),l=(r(f),function(e){function t(n,r){o(this,t);var a=i(this,e.call(this,n,r));return a.store=n.store,a}return a(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return u.Children.only(this.props.children)},t}(u.Component));t.default=l,l.propTypes={store:c.default.isRequired,children:u.PropTypes.element.isRequired},l.childContextTypes={store:c.default.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return e.displayName||e.name||"Component"}function s(e,t){try{return e.apply(t)}catch(e){return j.value=e,j}}function c(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=Boolean(e),d=e||O,h=void 0;h="function"==typeof t?t:t?(0,m.default)(t):x;var y=n||A,g=r.pure,_=void 0===g||g,b=r.withRef,E=void 0!==b&&b,R=_&&y!==A,P=k++;return function(e){function t(e,t,n){var r=y(e,t,n);return r}var n="Connect("+u(e)+")",r=function(r){function u(e,t){o(this,u);var a=i(this,r.call(this,e,t));a.version=P,a.store=e.store||t.store,(0,S.default)(a.store,'Could not find "store" in either the context or '+('props of "'+n+'". ')+"Either wrap the root component in a <Provider>, "+('or explicitly pass "store" as a prop to "'+n+'".'));var s=a.store.getState();return a.state={storeState:s},a.clearCache(),a}return a(u,r),u.prototype.shouldComponentUpdate=function(){return!_||this.haveOwnPropsChanged||this.hasStoreStateChanged},u.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},u.prototype.configureFinalMapState=function(e,t){var n=d(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:d,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},u.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},u.prototype.configureFinalMapDispatch=function(e,t){var n=h(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:h,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},u.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,v.default)(e,this.stateProps))&&(this.stateProps=e,!0)},u.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,v.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},u.prototype.updateMergedPropsIfNeeded=function(){var e=t(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&R&&(0,v.default)(e,this.mergedProps))&&(this.mergedProps=e,
!0)},u.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},u.prototype.trySubscribe=function(){c&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},u.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},u.prototype.componentDidMount=function(){this.trySubscribe()},u.prototype.componentWillReceiveProps=function(e){_&&(0,v.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},u.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},u.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},u.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!_||t!==e){if(_&&!this.doStatePropsDependOnOwnProps){var n=s(this.updateStatePropsIfNeeded,this);if(!n)return;n===j&&(this.statePropsPrecalculationError=j.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},u.prototype.getWrappedInstance=function(){return(0,S.default)(E,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},u.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.haveStatePropsBeenPrecalculated,o=this.statePropsPrecalculationError,i=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,o)throw o;var a=!0,u=!0;_&&i&&(a=n||t&&this.doStatePropsDependOnOwnProps,u=t&&this.doDispatchPropsDependOnOwnProps);var s=!1,c=!1;r?s=!0:a&&(s=this.updateStatePropsIfNeeded()),u&&(c=this.updateDispatchPropsIfNeeded());var d=!0;return d=!!(s||c||t)&&this.updateMergedPropsIfNeeded(),!d&&i?i:(E?this.renderedElement=(0,l.createElement)(e,f({},this.mergedProps,{ref:"wrappedInstance"})):this.renderedElement=(0,l.createElement)(e,this.mergedProps),this.renderedElement)},u}(l.Component);return r.displayName=n,r.WrappedComponent=e,r.contextTypes={store:p.default},r.propTypes={store:p.default},(0,w.default)(r,e)}}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=c;var l=n(0),d=n(43),p=r(d),h=n(93),v=r(h),y=n(94),m=r(y),g=n(44),_=(r(g),n(87)),b=(r(_),n(34)),w=r(b),E=n(1),S=r(E),O=function(e){return{}},x=function(e){return{dispatch:e}},A=function(e,t,n){return f({},n,e,t)},j={value:null},k=0},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e){return function(t){return(0,o.bindActionCreators)(e,t)}}t.__esModule=!0,t.default=r;var o=n(27)},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e){return function(){return function(t){return function(n){if(n.type!==i.CALL_HISTORY_METHOD)return t(n);var o=n.payload,a=o.method,u=o.args;e[a].apply(e,r(u))}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(45)},function(e,t,n){"use strict";function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.selectLocationState,u=void 0===r?a:r,s=n.adjustUrlOnReplay,c=void 0===s||s;if("undefined"==typeof u(t.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var f=void 0,l=void 0,d=void 0,p=void 0,h=void 0,v=function(e){var n=u(t.getState());return n.locationBeforeTransitions||(e?f:void 0)};if(f=v(),c){var y=function(){var t=v(!0);h!==t&&f!==t&&(l=!0,h=t,e.transitionTo(o({},t,{action:"PUSH"})),l=!1)};d=t.subscribe(y),y()}var m=function(e){l||(h=e,!f&&(f=e,v())||t.dispatch({type:i.LOCATION_CHANGE,payload:e}))};return p=e.listen(m),e.getCurrentLocation&&m(e.getCurrentLocation()),o({},e,{listen:function(e){var n=v(!0),r=!1,o=t.subscribe(function(){var t=v(!0);t!==n&&(n=t,r||e(n))});return e(n),function(){r=!0,o()}},unsubscribe:function(){c&&d(),p()}})}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=r;var i=n(46),a=function(e){return e.routing}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(0),a=r(i),u=n(47),s=r(u),c=a.default.createClass({displayName:"IndexLink",render:function(){return a.default.createElement(s.default,o({},this.props,{onlyActiveOnIndex:!0}))}});t.default=c,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(0),i=r(o),a=n(8),u=(r(a),n(1)),s=r(u),c=n(49),f=r(c),l=n(9),d=i.default.PropTypes,p=d.string,h=d.object,v=i.default.createClass({displayName:"IndexRedirect",statics:{createRouteFromReactElement:function(e,t){t&&(t.indexRoute=f.default.createRouteFromReactElement(e))}},propTypes:{to:p.isRequired,query:h,state:h,onEnter:l.falsy,children:l.falsy},render:function(){(0,s.default)(!1)}});t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(0),i=r(o),a=n(8),u=(r(a),n(1)),s=r(u),c=n(3),f=n(9),l=i.default.PropTypes.func,d=i.default.createClass({displayName:"IndexRoute",statics:{createRouteFromReactElement:function(e,t){t&&(t.indexRoute=(0,c.createRouteFromReactElement)(e))}},propTypes:{path:f.falsy,component:f.component,components:f.components,getComponent:l,getComponents:l},render:function(){(0,s.default)(!1)}});t.default=d,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(0),i=r(o),a=n(1),u=r(a),s=n(3),c=n(9),f=i.default.PropTypes,l=f.string,d=f.func,p=i.default.createClass({displayName:"Route",statics:{createRouteFromReactElement:s.createRouteFromReactElement},propTypes:{path:l,component:c.component,components:c.components,getComponent:d,getComponents:d},render:function(){(0,u.default)(!1)}});t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),u=r(a),s=n(0),c=r(s),f=n(53),l=r(f),d=n(9),p=n(26),h=r(p),v=n(3),y=n(50),m=n(8),g=(r(m),c.default.PropTypes),_=g.func,b=g.object,w=c.default.createClass({displayName:"Router",propTypes:{history:b,children:d.routes,routes:d.routes,render:_,createElement:_,onError:_,onUpdate:_,matchContext:b},getDefaultProps:function(){return{render:function(e){return c.default.createElement(h.default,e)}}},getInitialState:function(){return{location:null,routes:null,params:null,components:null}},handleError:function(e){if(!this.props.onError)throw e;this.props.onError.call(this,e)},createRouterObject:function(e){var t=this.props.matchContext;if(t)return t.router;var n=this.props.history;return(0,y.createRouterObject)(n,this.transitionManager,e)},createTransitionManager:function(){var e=this.props.matchContext;if(e)return e.transitionManager;var t=this.props.history,n=this.props,r=n.routes,o=n.children;return t.getCurrentLocation?void 0:(0,u.default)(!1),(0,l.default)(t,(0,v.createRoutes)(r||o))},componentWillMount:function(){var e=this;this.transitionManager=this.createTransitionManager(),this.router=this.createRouterObject(this.state),this._unlisten=this.transitionManager.listen(function(t,n){t?e.handleError(t):((0,y.assignRouterState)(e.router,n),e.setState(n,e.props.onUpdate))})},componentWillReceiveProps:function(e){},componentWillUnmount:function(){this._unlisten&&this._unlisten()},render:function e(){var t=this.state,n=t.location,r=t.routes,a=t.params,u=t.components,s=this.props,c=s.createElement,e=s.render,f=o(s,["createElement","render"]);return null==n?null:(Object.keys(w.propTypes).forEach(function(e){return delete f[e]}),e(i({},f,{router:this.router,location:n,routes:r,params:a,components:u,createElement:c})))}});t.default=w,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n,r){var o=e.length<n,i=function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];if(e.apply(t,r),o){var a=r[r.length-1];a()}};return r.add(i),i}function i(e){return e.reduce(function(e,t){return t.onEnter&&e.push(o(t.onEnter,t,3,p)),e},[])}function a(e){return e.reduce(function(e,t){return t.onChange&&e.push(o(t.onChange,t,4,h)),e},[])}function u(e,t,n){function r(e){o=e}if(!e)return void n();var o=void 0;(0,l.loopAsync)(e,function(e,n,i){t(e,r,function(e){e||o?i(e,o):n()})},n)}function s(e,t,n){p.clear();var r=i(e);return u(r.length,function(e,n,o){var i=function(){p.has(r[e])&&(o(),p.remove(r[e]))};r[e](t,n,i)},n)}function c(e,t,n,r){h.clear();var o=a(e);return u(o.length,function(e,r,i){var a=function(){h.has(o[e])&&(i(),h.remove(o[e]))};o[e](t,n,r,a)},r)}function f(e,t){for(var n=0,r=e.length;n<r;++n)e[n].onLeave&&e[n].onLeave.call(e[n],t)}t.__esModule=!0,t.runEnterHooks=s,t.runChangeHooks=c,t.runLeaveHooks=f;var l=n(23),d=function e(){var t=this;r(this,e),this.hooks=[],this.add=function(e){return t.hooks.push(e)},this.remove=function(e){return t.hooks=t.hooks.filter(function(t){return t!==e})},this.has=function(e){return t.hooks.indexOf(e)!==-1},this.clear=function(){return t.hooks=[]}},p=new d,h=new d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(0),a=r(i),u=n(26),s=r(u),c=n(8);r(c);t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(function(e){return e.renderRouterContext}).filter(Boolean),u=t.map(function(e){return e.renderRouteComponent}).filter(Boolean),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.createElement;return function(t,n){return u.reduceRight(function(e,t){return t(e,n)},e(t,n))}};return function(e){return r.reduceRight(function(t,n){return n(t,e)},a.default.createElement(s.default,o({},e,{createElement:c(e.createElement)})))}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(71),i=r(o),a=n(52),u=r(a);t.default=(0,u.default)(i.default),e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=(0,i.getParamNames)(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function o(e,t){var n=e&&e.routes,o=t.routes,i=void 0,a=void 0,u=void 0;return n?!function(){var s=!1;i=n.filter(function(n){if(s)return!0;var i=o.indexOf(n)===-1||r(n,e,t);return i&&(s=!0),i}),i.reverse(),u=[],a=[],o.forEach(function(e){var t=n.indexOf(e)===-1,r=i.indexOf(e)!==-1;t||r?u.push(e):a.push(e)})}():(i=[],a=[],u=o),{leaveRoutes:i,changeRoutes:a,enterRoutes:u}}t.__esModule=!0;var i=n(7);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){if(t.component||t.components)return void n(null,t.component||t.components);var r=t.getComponent||t.getComponents;if(r){var o=r.call(t,e,n);(0,a.isPromise)(o)&&o.then(function(e){return n(null,e)},n)}else n()}function o(e,t){(0,i.mapAsync)(e.routes,function(t,n,o){r(e,t,o)},t)}t.__esModule=!0;var i=n(23),a=n(48);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){var n={};return e.path?((0,o.getParamNames)(e.path).forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}),n):n}t.__esModule=!0;var o=n(7);t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(72),i=r(o),a=n(52),u=r(a);t.default=(0,u.default)(i.default),e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"===("undefined"==typeof e?"undefined":s(e))){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))if(void 0===e[n]){if(void 0!==t[n])return!1}else{if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!r(e[n],t[n]))return!1}return!0}return String(e)===String(t)}function o(e,t){return"/"!==t.charAt(0)&&(t="/"+t),"/"!==e.charAt(e.length-1)&&(e+="/"),"/"!==t.charAt(t.length-1)&&(t+="/"),t===e}function i(e,t,n){for(var r=e,o=[],i=[],a=0,u=t.length;a<u;++a){var s=t[a],f=s.path||"";if("/"===f.charAt(0)&&(r=e,o=[],i=[]),null!==r&&f){var l=(0,c.matchPattern)(f,r);if(l?(r=l.remainingPathname,o=[].concat(o,l.paramNames),i=[].concat(i,l.paramValues)):r=null,""===r)return o.every(function(e,t){return String(i[t])===String(n[e])})}}return!1}function a(e,t){return null==t?null==e:null==e||r(e,t)}function u(e,t,n,r,u){var s=e.pathname,c=e.query;return null!=n&&("/"!==s.charAt(0)&&(s="/"+s),!!(o(s,n.pathname)||!t&&i(s,r,u))&&a(c,n.query))}t.__esModule=!0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=u;var c=n(7);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){var n=e.history,r=e.routes,i=e.location,s=o(e,["history","routes","location"]);n||i?void 0:(0,c.default)(!1),n=n?n:(0,l.default)(s);var f=(0,p.default)(n,(0,h.createRoutes)(r));i=i?n.createLocation(i):n.getCurrentLocation(),f.match(i,function(e,r,o){var i=void 0;if(o){var s=(0,v.createRouterObject)(n,f,o);i=a({},o,{router:s,matchContext:{transitionManager:f,router:s}})}t(e,r&&n.createLocation(r,u.REPLACE),i)})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(11),s=n(1),c=r(s),f=n(51),l=r(f),d=n(53),p=r(d),h=n(3),v=n(50);t.default=i,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r,o){if(e.childRoutes)return[null,e.childRoutes];if(!e.getChildRoutes)return[];var i=!0,a=void 0,s={location:t,params:u(n,r)},c=e.getChildRoutes(s,function(e,t){return t=!e&&(0,y.createRoutes)(t),i?void(a=[e,t]):void o(e,t)});return(0,p.isPromise)(c)&&c.then(function(e){return o(null,(0,y.createRoutes)(e))},o),i=!1,a}function i(e,t,n,r,o){if(e.indexRoute)o(null,e.indexRoute);else if(e.getIndexRoute){var a={location:t,params:u(n,r)},s=e.getIndexRoute(a,function(e,t){o(e,!e&&(0,y.createRoutes)(t)[0])});(0,p.isPromise)(s)&&s.then(function(e){return o(null,(0,y.createRoutes)(e)[0])},o)}else e.childRoutes?!function(){var a=e.childRoutes.filter(function(e){return!e.path});(0,d.loopAsync)(a.length,function(e,o,u){i(a[e],t,n,r,function(t,n){if(t||n){var r=[a[e]].concat(Array.isArray(n)?n:[n]);u(t,r)}else o()})},function(e,t){o(null,t)})}():o()}function a(e,t,n){return t.reduce(function(e,t,r){var o=n&&n[r];return Array.isArray(e[t])?e[t].push(o):t in e?e[t]=[e[t],o]:e[t]=o,e},e)}function u(e,t){return a({},e,t)}function s(e,t,n,r,a,s){var f=e.path||"";if("/"===f.charAt(0)&&(n=t.pathname,r=[],a=[]),null!==n&&f){try{var d=(0,h.matchPattern)(f,n);d?(n=d.remainingPathname,r=[].concat(r,d.paramNames),a=[].concat(a,d.paramValues)):n=null}catch(e){s(e)}if(""===n){var p=function(){var n={routes:[e],params:u(r,a)};return i(e,t,r,a,function(e,t){if(e)s(e);else{if(Array.isArray(t)){var r;(r=n.routes).push.apply(r,t)}else t&&n.routes.push(t);s(null,n)}}),{v:void 0}}();if("object"===("undefined"==typeof p?"undefined":l(p)))return p.v}}if(null!=n||e.childRoutes){var v=function(o,i){o?s(o):i?c(i,t,function(t,n){t?s(t):n?(n.routes.unshift(e),s(null,n)):s()},n,r,a):s()},y=o(e,t,r,a,v);y&&v.apply(void 0,y)}else s()}function c(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];void 0===r&&("/"!==t.pathname.charAt(0)&&(t=f({},t,{pathname:"/"+t.pathname})),r=t.pathname),(0,d.loopAsync)(e.length,function(n,a,u){s(e[n],t,r,o,i,function(e,t){e||t?u(e,t):a()})},n)}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=c;var d=n(23),p=n(48),h=n(7),v=n(8),y=(r(v),n(3));e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return e.displayName||e.name||"Component"}function i(e,t){var n=t&&t.withRef,r=f.default.createClass({displayName:"WithRouter",mixins:[(0,p.ContextSubscriber)("router")],contextTypes:{router:h.routerShape},propTypes:{router:h.routerShape},getWrappedInstance:function(){return n?void 0:(0,s.default)(!1),this.wrappedInstance},render:function(){var t=this,r=this.props.router||this.context.router,o=r.params,i=r.location,u=r.routes,s=a({},this.props,{router:r,params:o,location:i,routes:u});return n&&(s.ref=function(e){t.wrappedInstance=e}),f.default.createElement(e,s)}});return r.displayName="withRouter("+o(e)+")",r.WrappedComponent=e,(0,d.default)(r,e)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=i;var u=n(1),s=r(u),c=n(0),f=r(c),l=n(34),d=r(l),p=n(24),h=n(25);e.exports=t.default},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,a){var u=e(n,r,a),s=u.dispatch,c=[],f={getState:u.getState,dispatch:function(e){return s(e)}};return c=t.map(function(e){return e(f)}),s=o.a.apply(void 0,c)(u.dispatch),i({},u,{dispatch:s})}}}var o=n(55);t.a=r;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function o(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),o={},i=0;i<n.length;i++){var a=n[i],u=e[a];"function"==typeof u&&(o[a]=r(u,t))}return o}t.a=o},function(e,t,n){"use strict";function r(e,t){var n=t&&t.type,r=n&&'"'+n.toString()+'"'||"an action";return"Given action "+r+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function o(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:a.b.INIT});if("undefined"==typeof r)throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var o="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:o}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+a.b.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function i(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++){var a=t[i];"function"==typeof e[a]&&(n[a]=e[a])}var u,s=Object.keys(n);try{o(n)}catch(e){u=e}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];if(u)throw u;for(var o=!1,i={},a=0;a<s.length;a++){var c=s[a],f=n[c],l=e[c],d=f(l,t);if("undefined"==typeof d){var p=r(c,t);throw new Error(p)}i[c]=d,o=o||d!==l}return o?i:e}}var a=n(56);n(39),n(57);t.a=i},function(e,t){(function(){var t={}.hasOwnProperty,n=[].slice;e.exports=function(e,r){var o,i,a,u;i=[],u=[];for(o in r)t.call(r,o)&&(a=r[o],"this"!==o&&(i.push(o),u.push(a)));return Function.apply(null,n.call(i).concat([e])).apply(r.this,u)}}).call(this)},function(e,t,n){!function(t){e.exports=t()}(function(e){"use strict";function t(e,t){var n=e[0],r=e[1],o=e[2],i=e[3];n+=(r&o|~r&i)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[1]-389564586|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[2]+606105819|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[5]+1200080426|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[6]-1473231341|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[9]-1958414417|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[10]-42063|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[13]-40341101|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[14]-1502002290|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+o|0,n+=(r&i|o&~i)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[6]-1069501632|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[11]+643717713|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[10]+38016083|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[15]-660478335|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[14]-1019803690|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[3]-187363961|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[2]-51403784|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[7]+1735328473|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+o|0,n+=(r^o^i)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[8]-2022574463|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[11]+1839030562|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[4]+1272893353|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[7]-155497632|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[0]-358537222|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[3]-722521979|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[12]-421815835|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[15]+530742520|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+o|0,n+=(o^(r|~i))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[7]+1126891415|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[14]-1416354905|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[3]-1894986606|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[10]-1051523|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[15]-30611744|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[6]-1560198380|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[11]-1120210379|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[2]+718787259|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+o|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=o+e[2]|0,e[3]=i+e[3]|0}function n(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function r(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function o(e){var r,o,i,a,u,s,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=c;r+=64)t(f,n(e.substring(r-64,r)));for(e=e.substring(r-64),o=e.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<o;r+=1)i[r>>2]|=e.charCodeAt(r)<<(r%4<<3);if(i[r>>2]|=128<<(r%4<<3),r>55)for(t(f,i),r=0;r<16;r+=1)i[r]=0;return a=8*c,a=a.toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(a[2],16),s=parseInt(a[1],16)||0,i[14]=u,i[15]=s,t(f,i),f}function i(e){var n,o,i,a,u,s,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=c;n+=64)t(f,r(e.subarray(n-64,n)));for(e=n-64<c?e.subarray(n-64):new Uint8Array(0),o=e.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<o;n+=1)i[n>>2]|=e[n]<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(t(f,i),n=0;n<16;n+=1)i[n]=0;return a=8*c,a=a.toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(a[2],16),s=parseInt(a[1],16)||0,i[14]=u,i[15]=s,t(f,i),f}function a(e){var t,n="";for(t=0;t<4;t+=1)n+=v[e>>8*t+4&15]+v[e>>8*t&15];return n}function u(e){var t;for(t=0;t<e.length;t+=1)e[t]=a(e[t]);return e.join("")}function s(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function c(e,t){var n,r=e.length,o=new ArrayBuffer(r),i=new Uint8Array(o);for(n=0;n<r;n+=1)i[n]=e.charCodeAt(n);return t?i:o}function f(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function l(e,t,n){var r=new Uint8Array(e.byteLength+t.byteLength);return r.set(new Uint8Array(e)),r.set(new Uint8Array(t),e.byteLength),n?r:r.buffer}function d(e){var t,n=[],r=e.length;for(t=0;t<r-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}var h=function(e,t){return e+t&4294967295},v=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return"5d41402abc4b2a76b9719d911017c592"!==u(o("hello"))&&(h=function(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||!function(){function t(e,t){return e=0|e||0,e<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var o,i,a,u,s=this.byteLength,c=t(n,s),f=s;return r!==e&&(f=t(r,s)),c>f?new ArrayBuffer(0):(o=f-c,i=new ArrayBuffer(o),a=new Uint8Array(i),u=new Uint8Array(this,c,o),a.set(u),i)}}(),p.prototype.append=function(e){return this.appendBinary(s(e)),this},p.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var r,o=this._buff.length;for(r=64;r<=o;r+=64)t(this._hash,n(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},p.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(i,o),n=u(this._hash),e&&(n=d(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},p.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(e,n){var r,o,i,a=n;if(e[a>>2]|=128<<(a%4<<3),a>55)for(t(this._hash,e),a=0;a<16;a+=1)e[a]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),i=parseInt(r[1],16)||0,e[14]=o,e[15]=i,t(this._hash,e)},p.hash=function(e,t){return p.hashBinary(s(e),t)},p.hashBinary=function(e,t){var n=o(e),r=u(n);return t?d(r):r},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(e){var n,o=l(this._buff.buffer,e,!0),i=o.length;for(this._length+=e.byteLength,n=64;n<=i;n+=64)t(this._hash,r(o.subarray(n-64,n)));return this._buff=n-64<i?new Uint8Array(o.buffer.slice(n-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=r[t]<<(t%4<<3);return this._finish(i,o),n=u(this._hash),e&&(n=d(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var e=p.prototype.getState.call(this);return e.buff=f(e.buff),e},p.ArrayBuffer.prototype.setState=function(e){return e.buff=c(e.buff,!0),p.prototype.setState.call(this,e)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(e,t){var n=i(new Uint8Array(e)),r=u(n);return t?d(r):r},p})},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t,n){e.exports=n(120)},function(e,t,n){"use strict";(function(e,r){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(121),u=o(a);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof e?e:r;var s=(0,u.default)(i);t.default=s}).call(t,n(5),n(123)(e))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";function r(e,t,n){var r=n[n.length-1];e===r.element&&(n.pop(),r=n[n.length-1]);var o=r.element,i=r.index;if(Array.isArray(o))o.push(e);else if(i===t.length-2){var a=t.pop();o[a]=e}else t.push(e)}t.stringify=function(e){var t=[];t.push({obj:e});for(var n,r,o,i,a,u,s,c,f,l,d,p="";n=t.pop();)if(r=n.obj,o=n.prefix||"",i=n.val||"",p+=o,i)p+=i;else if("object"!=typeof r)p+="undefined"==typeof r?null:JSON.stringify(r);else if(null===r)p+="null";else if(Array.isArray(r)){for(t.push({val:"]"}),a=r.length-1;a>=0;a--)u=0===a?"":",",t.push({obj:r[a],prefix:u});t.push({val:"["})}else{s=[];for(c in r)r.hasOwnProperty(c)&&s.push(c);for(t.push({val:"}"}),a=s.length-1;a>=0;a--)f=s[a],l=r[f],d=a>0?",":"",d+=JSON.stringify(f)+":",t.push({obj:l,prefix:d});t.push({val:"{"})}return p},t.parse=function(e){for(var t,n,o,i,a,u,s,c,f,l=[],d=[],p=0;;)if(t=e[p++],"}"!==t&&"]"!==t&&"undefined"!=typeof t)switch(t){
case" ":case"\t":case"\n":case":":case",":break;case"n":p+=3,r(null,l,d);break;case"t":p+=3,r(!0,l,d);break;case"f":p+=4,r(!1,l,d);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",p--;;){if(o=e[p++],!/[\d\.\-e\+]/.test(o)){p--;break}n+=o}r(parseFloat(n),l,d);break;case'"':for(i="",a=void 0,u=0;;){if(s=e[p++],'"'===s&&("\\"!==a||u%2!==1))break;i+=s,a=s,"\\"===a?u++:u=0}r(JSON.parse('"'+i+'"'),l,d);break;case"[":c={element:[],index:l.length},l.push(c.element),d.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),d.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,d)}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=n(58),i=r(o),a=n(28),u=r(a),s=n(10),c=r(s),f=n(29),l=r(f),d=n(61),p=r(d),h=n(60),v=n(30),y=r(v),m=n(59),g=r(m),_=n(14),b=r(_),w=n(15),E=n(16);e.exports={Component:i.default,CombineState:u.default,CreateStore:c.default,ConnectStore:l.default,Render:p.default,Rerender:h.Rerender,HistoryMode:b.default,Router:y.default,store:s.store,devToolsConfig:s.devToolsConfig,State:w.State,Effect:w.Effect,Hook:w.Hook,Actions:w.Actions,ActionCreators:w.ActionCreators,StateDefaults:w.StateDefaults,getState:w.getState,dispatch:w.dispatch,Route:E.Route,IndexRoute:E.IndexRoute,Redirect:E.Redirect,IndexRedirect:E.IndexRedirect,Link:E.Link,IndexLink:E.IndexLink,Goto:g.default}}])});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment