diff --git a/CHANGELOG.md b/CHANGELOG.md index e63854a17..ef12b8530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +## [v1.9.2](https://github.com/netlify/netlify-identity-widget/compare/v1.9.1...v1.9.2) + +### Merged + +- fix: remove identity prefix from site URL if exists [`#482`](https://github.com/netlify/netlify-identity-widget/pull/482) +- feat: Czech and Slovak translations [`#439`](https://github.com/netlify/netlify-identity-widget/pull/439) +- chore(deps): update dependency gh-release to v5 [`#422`](https://github.com/netlify/netlify-identity-widget/pull/422) +- feat: add polish translations [`#409`](https://github.com/netlify/netlify-identity-widget/pull/409) +- chore(deps): update dependency webpack-cli to v4 [`#387`](https://github.com/netlify/netlify-identity-widget/pull/387) +- chore(renovate): add pr labels [`#374`](https://github.com/netlify/netlify-identity-widget/pull/374) +- chore(deps): update dependency eslint-config-prettier to v8 [`#431`](https://github.com/netlify/netlify-identity-widget/pull/431) +- chore(deps): bump elliptic from 6.5.3 to 6.5.4 [`#436`](https://github.com/netlify/netlify-identity-widget/pull/436) +- chore(deps): bump elliptic from 6.5.3 to 6.5.4 in /example/react [`#437`](https://github.com/netlify/netlify-identity-widget/pull/437) +- chore(deps): bump ssri from 6.0.1 to 6.0.2 in /example/react [`#444`](https://github.com/netlify/netlify-identity-widget/pull/444) +- chore(deps): bump ssri from 6.0.1 to 6.0.2 [`#446`](https://github.com/netlify/netlify-identity-widget/pull/446) +- chore(deps): bump handlebars from 4.7.6 to 4.7.7 [`#448`](https://github.com/netlify/netlify-identity-widget/pull/448) +- chore(deps): bump url-parse from 1.4.7 to 1.5.1 [`#449`](https://github.com/netlify/netlify-identity-widget/pull/449) +- chore(deps): bump url-parse from 1.4.7 to 1.5.1 in /example/react [`#450`](https://github.com/netlify/netlify-identity-widget/pull/450) +- Fix: Replacement typo on `white-space` property [`#435`](https://github.com/netlify/netlify-identity-widget/pull/435) +- Add branded README image [`#434`](https://github.com/netlify/netlify-identity-widget/pull/434) +- chore(deps): update actions/setup-node action to v2 [`#411`](https://github.com/netlify/netlify-identity-widget/pull/411) +- chore(deps): lock file maintenance [`#392`](https://github.com/netlify/netlify-identity-widget/pull/392) +- chore(deps): update babel monorepo [`#390`](https://github.com/netlify/netlify-identity-widget/pull/390) +- chore(deps): update babel monorepo [`#338`](https://github.com/netlify/netlify-identity-widget/pull/338) +- chore(deps): bump node-fetch from 2.6.0 to 2.6.1 [`#364`](https://github.com/netlify/netlify-identity-widget/pull/364) +- chore: module example code typo [`#359`](https://github.com/netlify/netlify-identity-widget/pull/359) +- feat: Russian translation [`#354`](https://github.com/netlify/netlify-identity-widget/pull/354) +- chore: clarify use of global script version [`#357`](https://github.com/netlify/netlify-identity-widget/pull/357) +- feat: Portuguese translation [`#352`](https://github.com/netlify/netlify-identity-widget/pull/352) +- fix: add missing translations [`#353`](https://github.com/netlify/netlify-identity-widget/pull/353) + +### Fixed + +- chore: clarify use of global script version (#357) [`#355`](https://github.com/netlify/netlify-identity-widget/issues/355) + +### Commits + +- Update yarn lockfile [`ad7d5c6`](https://github.com/netlify/netlify-identity-widget/commit/ad7d5c6c89cf2006f8f78619f42edaf2abe84a63) +- chore(deps): update jest monorepo to v26.6.3 [`6fadf3b`](https://github.com/netlify/netlify-identity-widget/commit/6fadf3b4ca834f097647e95f966fc877cdc7bf30) +- chore(deps): update dependency eslint to v7.26.0 [`e47ee6f`](https://github.com/netlify/netlify-identity-widget/commit/e47ee6fd642581cc67fc2d1e05cb26fc4f632f35) + ## [v1.9.1](https://github.com/netlify/netlify-identity-widget/compare/v1.9.0...v1.9.1) - 2020-07-30 ### Merged diff --git a/package.json b/package.json index 7a545c039..f30169645 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "netlify-identity-widget", "description": "Netlify Identity widget for easy integration", - "version": "1.9.1", + "version": "1.9.2", "author": "Matt Biilmann ", "bugs": { "url": "https://github.com/netlify/netlify-identity-widget/issues" diff --git a/releases/v1/foo.html b/releases/v1/foo.html index 82ac71e12..3dfbafe90 100644 --- a/releases/v1/foo.html +++ b/releases/v1/foo.html @@ -1,4 +1,4 @@ -Netlify Identity Widget

Netlify Identity

Auth widget demo

Single button example:
Multiple buttons example:
\ No newline at end of file + margin: 0; + padding: 0; + } + + body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; + margin: 0; + border-top: 8px solid #0e1e25; + } + + .main { + max-width: 800px; + margin: auto; + min-height: 100vh; + display: flex; + justify-content: center; + flex-direction: column; + } + + .header { + margin-bottom: 64px; + } + + .header h2 { + font-weight: 500; + font-size: 24px; + color: #2d3b41; + margin: 0; + } + + .header a { + color: inherit; + text-decoration: none; + border-radius: 4px; + padding: 4px; + } + + .header a:hover, + .header a:focus { + background-color: #E9EBEB; + } + + + .header h1 { + font-weight: 700; + font-size: 80px; + color: #0e1e25; + margin-top: 8px; + } + + .label { + font-weight: 400; + font-size: 16px; + color: #a3a9ac; + margin-bottom: 8px; + } + + [data-netlify-identity-button] a { + display: block; + position: relative; + width: 100%; + max-width: 184px; + height: auto; + padding: 8px 12px; + outline: 0; + cursor: pointer; + border: 2px solid #007a70; + border-radius: 4px; + background-color: #00ad9F; + color: white; + transition: background-color 0.2s ease; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; + font-size: 16px; + font-weight: 500; + line-height: 24px; + text-align: center; + text-decoration: none; + white-space: nowrap; + } + + [data-netlify-identity-button] a:hover, + [data-netlify-identity-button] a:focus { + background-color: #007a70; + text-decoration: none; + } + + [data-netlify-identity-menu] ul { + display: flex; + } + + [data-netlify-identity-menu] li:first-child { + margin-right: 16px; + } + + [data-netlify-identity-menu] li { + list-style-type: none; + display: inline-block; + } + + [data-netlify-identity-menu] a { + display: block; + position: relative; + width: 192px; + height: 24px; + padding: 8px; + outline: 0; + cursor: pointer; + border: 2px solid #007a70; + border-radius: 4px; + background-color: #00ad9F; + color: white; + transition: background-color 0.2s ease; + font-size: 16px; + font-weight: 500; + line-height: 24px; + text-align: center; + text-decoration: none; + white-space: nowrap; + } + + [data-netlify-identity-menu] a:hover, + [data-netlify-identity-menu] a:focus { + background-color: #007a70; + text-decoration: none; + } + + .netlify-identity-user-details { + display: block; + } + + .netlify-identity-user { + font-weight: 500; + color: #2d3b41; + display: block; + margin-top: 8px; + } + + .hands-on-area { + display: flex; + margin-bottom: 40px; + } + + .single-button { + flex-grow: 1; + margin-right: 104px; + margin-bottom: 40px; + } + + .multiple-buttons { + flex-grow: 2; + } + + .single-button div { + margin-top: 8px; + } + + .multiple-buttons div { + margin-top: 8px; + } + + .call-out svg { + display: block; + margin-left: 40px; + width: 90%; + max-width: 420px; + } + + .footer { + position: absolute; + bottom: 32px; + margin-top: 104px; + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + max-width: 800px; + } + + .github-link { + font-weight: 500; + font-size: 16px; + color: inherit; + text-decoration: none; + } + + .github-link:hover, + .github-link:focus { + text-decoration: underline; + } + + .github-link::before { + display: inline-block; + position: relative; + top: 4px; + content: " "; + width: 19px; + height: 19px; + margin-right: 8px; + background-position: center center; + background-repeat: no-repeat; + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4gIDxwYXRoIGZpbGw9IiMxNjE1MTQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTkuNDk5MjM0NTUsMS4xODc1IEM0LjkwOTYxMzk0LDEuMTg3NSAxLjE4NzUsNS4wMDMyODcwNCAxLjE4NzUsOS43MTA2Mjc3OCBDMS4xODc1LDEzLjQ3NjE4NjQgMy41NjkwNjA5NywxNi42NzAzOTczIDYuODcyMjIwMjIsMTcuNzk3Mzk2NSBDNy4yODgxMTMxMywxNy44NzU4Nzg0IDcuNDM5NjcxNjQsMTcuNjEyNzAyNiA3LjQzOTY3MTY0LDE3LjM4NjY3NDkgQzcuNDM5NjcxNjQsMTcuMTg0NzE1IDcuNDMyNTI3NDcsMTYuNjQ4NDIyNCA3LjQyODQ0NTA5LDE1LjkzNzM3NjkgQzUuMTE2Mjg0NjUsMTYuNDUyMjE3OCA0LjYyODQzOTcyLDE0Ljc5NDY4MTMgNC42Mjg0Mzk3MiwxNC43OTQ2ODEzIEM0LjI1MDMwODg2LDEzLjgwOTk5NTkgMy43MDUzMTA1NSwxMy41NDc4NjY1IDMuNzA1MzEwNTUsMTMuNTQ3ODY2NSBDMi45NTA1Nzk3NCwxMy4wMTk0MjIxIDMuNzYyNDYzOTMsMTMuMDI5ODg2NCAzLjc2MjQ2MzkzLDEzLjAyOTg4NjQgQzQuNTk2ODAxMjQsMTMuMDkwMDU1OCA1LjAzNTY1NzU2LDEzLjkwODM1OTggNS4wMzU2NTc1NiwxMy45MDgzNTk4IEM1Ljc3NzEyMDYxLDE1LjIxMDYzNTEgNi45ODE0MjQsMTQuODM0NDQ1NSA3LjQ1NDk4MDU5LDE0LjYxNjI2NiBDNy41MzA1MDQ3LDE0LjA2NTg0NjcgNy43NDUzNDAxNywxMy42OTAxODAzIDcuOTgyNjI4NzYsMTMuNDc3MjMyOSBDNi4xMzY4ODA3NCwxMy4yNjIxOTI2IDQuMTk2MjE3MjcsMTIuNTMwNzQxOSA0LjE5NjIxNzI3LDkuMjY0ODUwOTMgQzQuMTk2MjE3MjcsOC4zMzQ1Nzk1MyA0LjUyMDI1NjUzLDcuNTczMzA1NjggNS4wNTE5ODcwOSw2Ljk3Nzg5MDEzIEM0Ljk2NjI1NzAyLDYuNzYyMzI2NjcgNC42ODEwMDA0MSw1Ljg5NTM2Mzk1IDUuMTMzNjM0NzgsNC43MjIzMjIwNiBDNS4xMzM2MzQ3OCw0LjcyMjMyMjA2IDUuODMxMjEyMjEsNC40OTMxNTUwOCA3LjQxOTI1OTcyLDUuNTk2MDg2NTQgQzguMDgyMTM2ODgsNS40MDY2ODM3IDguNzkzNDkyMzYsNS4zMTI1MDU0OSA5LjUwMDI1NTE1LDUuMzA4ODQzIEMxMC4yMDY1MDc2LDUuMzEyNTA1NDkgMTAuOTE3MzUyOCw1LjQwNjY4MzcgMTEuNTgxMjUwNiw1LjU5NjA4NjU0IEMxMy4xNjgyNzc1LDQuNDkzMTU1MDggMTMuODY0ODM0Myw0LjcyMjMyMjA2IDEzLjg2NDgzNDMsNC43MjIzMjIwNiBDMTQuMzE4NDg5Myw1Ljg5NTM2Mzk1IDE0LjAzMzIzMjcsNi43NjIzMjY2NyAxMy45NDgwMTI5LDYuOTc3ODkwMTMgQzE0LjQ4MDc2NDEsNy41NzMzMDU2OCAxNC44MDIyNTE4LDguMzM0NTc5NTMgMTQuODAyMjUxOCw5LjI2NDg1MDkzIEMxNC44MDIyNTE4LDEyLjUzOTExMzMgMTIuODU4NTI2NiwxMy4yNTk1NzY2IDExLjAwNzE2NTMsMTMuNDcwNDMxMSBDMTEuMzA1MTc5MywxMy43MzM2MDY5IDExLjU3MTA0NDYsMTQuMjUzNjc5OSAxMS41NzEwNDQ2LDE1LjA0ODk2MjUgQzExLjU3MTA0NDYsMTYuMTg3OTk1NiAxMS41NjA4Mzg3LDE3LjEwNzI3OTYgMTEuNTYwODM4NywxNy4zODY2NzQ5IEMxMS41NjA4Mzg3LDE3LjYxNDc5NTUgMTEuNzEwODY2MywxNy44ODAwNjQxIDEyLjEzMjM3MjUsMTcuNzk2ODczMyBDMTUuNDMyOTgwMiwxNi42NjcyNTggMTcuODEyNSwxMy40NzUxNCAxNy44MTI1LDkuNzEwNjI3NzggQzE3LjgxMjUsNS4wMDMyODcwNCAxNC4wOTAzODYxLDEuMTg3NSA5LjQ5OTIzNDU1LDEuMTg3NSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEgLTEpIi8+PC9zdmc+); + } + + .select-locale { + font-weight: 500; + font-size: 16px; + color: inherit; + text-decoration: none; + } + + @media (max-width: 880px) { + .main { + padding: 16px; + } + + .header h1 { + font-size: 10vw; + } + + .hands-on-area { + flex-direction: column; + } + + [data-netlify-identity-menu] ul { + display: flex; + flex-direction: column; + } + + [data-netlify-identity-menu] li { + margin-bottom: 16px; + } + } + + @media screen and (max-height: 680px) { + .main { + padding: 64px 0; + } + + .footer { + position: relative; + bottom: auto; + } + }

Netlify Identity

Auth widget demo

Single button example:
Multiple buttons example:
\ No newline at end of file diff --git a/releases/v1/netlify-identity-widget.js b/releases/v1/netlify-identity-widget.js index fa4c30c91..26ea028f5 100644 --- a/releases/v1/netlify-identity-widget.js +++ b/releases/v1/netlify-identity-widget.js @@ -1,4 +1,4 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=8)}([function(e,t,n){"use strict";n.r(t),n.d(t,"h",(function(){return a})),n.d(t,"createElement",(function(){return a})),n.d(t,"cloneElement",(function(){return N})),n.d(t,"createRef",(function(){return B})),n.d(t,"Component",(function(){return Y})),n.d(t,"render",(function(){return Q})),n.d(t,"rerender",(function(){return y})),n.d(t,"options",(function(){return o}));var r=function(){},o={},M=[],i=[];function a(e,t){var n,a,u,s,c=i;for(s=arguments.length;s-- >2;)M.push(arguments[s]);for(t&&null!=t.children&&(M.length||M.push(t.children),delete t.children);M.length;)if((a=M.pop())&&void 0!==a.pop)for(s=a.length;s--;)M.push(a[s]);else"boolean"==typeof a&&(a=null),(u="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(u=!1)),u&&n?c[c.length-1]+=a:c===i?c=[a]:c.push(a),n=u;var N=new r;return N.nodeName=e,N.children=c,N.attributes=null==t?void 0:t,N.key=null==t?void 0:t.key,void 0!==o.vnode&&o.vnode(N),N}function u(e,t){for(var n in t)e[n]=t[n];return e}function s(e,t){e&&("function"==typeof e?e(t):e.current=t)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function N(e,t){return a(e.nodeName,u(u({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var l=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,D=[];function g(e){!e._dirty&&(e._dirty=!0)&&1==D.push(e)&&(o.debounceRendering||c)(y)}function y(){for(var e;e=D.pop();)e._dirty&&S(e)}function j(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&z(e,t.nodeName):n||e._componentConstructor===t.nodeName}function z(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function T(e){var t=u({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function A(e){var t=e.parentNode;t&&t.removeChild(e)}function f(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)s(n,null),s(r,e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var M in n)M in r||(e.style[M]="");for(var M in r)e.style[M]="number"==typeof r[M]&&!1===l.test(M)?r[M]+"px":r[M]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var i=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,d,i):e.removeEventListener(t,d,i),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var a=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function d(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var p=[],E=0,I=!1,w=!1;function O(){for(var e;e=p.shift();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount()}function x(e,t,n,r,o,M){E++||(I=null!=o&&void 0!==o.ownerSVGElement,w=null!=e&&!("__preactattr_"in e));var i=L(e,t,n,r,M);return o&&i.parentNode!==o&&o.appendChild(i),--E||(w=!1,M||O()),i}function L(e,t,n,r,o){var M=e,i=I;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(M=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(M,e),h(e,!0))),M.__preactattr_=!0,M;var a,u,s=t.nodeName;if("function"==typeof s)return function(e,t,n,r){var o=e&&e._component,M=o,i=e,a=o&&e._componentConstructor===t.nodeName,u=a,s=T(t);for(;o&&!u&&(o=o._parentComponent);)u=o.constructor===t.nodeName;o&&u&&(!r||o._component)?(C(o,s,3,n,r),e=o.base):(M&&!a&&(U(M),e=i=null),o=k(t.nodeName,s,n),e&&!o.nextBase&&(o.nextBase=e,i=null),C(o,s,1,n,r),e=o.base,i&&e!==i&&(i._component=null,h(i,!1)));return e}(e,t,n,r);if(I="svg"===s||"foreignObject"!==s&&I,s=String(s),(!e||!z(e,s))&&(a=s,(u=I?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,M=u,e)){for(;e.firstChild;)M.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(M,e),h(e,!0)}var c=M.firstChild,N=M.__preactattr_,l=t.children;if(null==N){N=M.__preactattr_={};for(var D=M.attributes,g=D.length;g--;)N[D[g].name]=D[g].value}return!w&&l&&1===l.length&&"string"==typeof l[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=l[0]&&(c.nodeValue=l[0]):(l&&l.length||null!=c)&&function(e,t,n,r,o){var M,i,a,u,s,c=e.childNodes,N=[],l={},D=0,g=0,y=c.length,z=0,T=t?t.length:0;if(0!==y)for(var f=0;f2;)i.push(arguments[s]);for(n&&null!=n.children&&(i.length||i.push(n.children),delete n.children);i.length;)if((a=i.pop())&&void 0!==a.pop)for(s=a.length;s--;)i.push(a[s]);else"boolean"==typeof a&&(a=null),(u="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(u=!1)),u&&t?c[c.length-1]+=a:c===M?c=[a]:c.push(a),t=u;var l=new r;return l.nodeName=e,l.children=c,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==o.vnode&&o.vnode(l),l}function u(e,n){for(var t in n)e[t]=n[t];return e}function s(e,n){e&&("function"==typeof e?e(n):e.current=n)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function l(e,n){return a(e.nodeName,u(u({},e.attributes),n),arguments.length>2?[].slice.call(arguments,2):e.children)}var N=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,D=[];function g(e){!e._dirty&&(e._dirty=!0)&&1==D.push(e)&&(o.debounceRendering||c)(y)}function y(){for(var e;e=D.pop();)e._dirty&&S(e)}function j(e,n,t){return"string"==typeof n||"number"==typeof n?void 0!==e.splitText:"string"==typeof n.nodeName?!e._componentConstructor&&z(e,n.nodeName):t||e._componentConstructor===n.nodeName}function z(e,n){return e.normalizedNodeName===n||e.nodeName.toLowerCase()===n.toLowerCase()}function T(e){var n=u({},e.attributes);n.children=e.children;var t=e.nodeName.defaultProps;if(void 0!==t)for(var r in t)void 0===n[r]&&(n[r]=t[r]);return n}function f(e){var n=e.parentNode;n&&n.removeChild(e)}function A(e,n,t,r,o){if("className"===n&&(n="class"),"key"===n);else if("ref"===n)s(t,null),s(r,e);else if("class"!==n||o)if("style"===n){if(r&&"string"!=typeof r&&"string"!=typeof t||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof t)for(var i in t)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===N.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===n)r&&(e.innerHTML=r.__html||"");else if("o"==n[0]&&"n"==n[1]){var M=n!==(n=n.replace(/Capture$/,""));n=n.toLowerCase().substring(2),r?t||e.addEventListener(n,d,M):e.removeEventListener(n,d,M),(e._listeners||(e._listeners={}))[n]=r}else if("list"!==n&&"type"!==n&&!o&&n in e){try{e[n]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==n||e.removeAttribute(n)}else{var a=o&&n!==(n=n.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase()):e.removeAttribute(n):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase(),r):e.setAttribute(n,r))}else e.className=r||""}function d(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var p=[],E=0,w=!1,I=!1;function O(){for(var e;e=p.shift();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount()}function x(e,n,t,r,o,i){E++||(w=null!=o&&void 0!==o.ownerSVGElement,I=null!=e&&!("__preactattr_"in e));var M=L(e,n,t,r,i);return o&&M.parentNode!==o&&o.appendChild(M),--E||(I=!1,i||O()),M}function L(e,n,t,r,o){var i=e,M=w;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=n&&(e.nodeValue=n):(i=document.createTextNode(n),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),h(e,!0))),i.__preactattr_=!0,i;var a,u,s=n.nodeName;if("function"==typeof s)return function(e,n,t,r){var o=e&&e._component,i=o,M=e,a=o&&e._componentConstructor===n.nodeName,u=a,s=T(n);for(;o&&!u&&(o=o._parentComponent);)u=o.constructor===n.nodeName;o&&u&&(!r||o._component)?(C(o,s,3,t,r),e=o.base):(i&&!a&&(U(i),e=M=null),o=b(n.nodeName,s,t),e&&!o.nextBase&&(o.nextBase=e,M=null),C(o,s,1,t,r),e=o.base,M&&e!==M&&(M._component=null,h(M,!1)));return e}(e,n,t,r);if(w="svg"===s||"foreignObject"!==s&&w,s=String(s),(!e||!z(e,s))&&(a=s,(u=w?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,i=u,e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),h(e,!0)}var c=i.firstChild,l=i.__preactattr_,N=n.children;if(null==l){l=i.__preactattr_={};for(var D=i.attributes,g=D.length;g--;)l[D[g].name]=D[g].value}return!I&&N&&1===N.length&&"string"==typeof N[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=N[0]&&(c.nodeValue=N[0]):(N&&N.length||null!=c)&&function(e,n,t,r,o){var i,M,a,u,s,c=e.childNodes,l=[],N={},D=0,g=0,y=c.length,z=0,T=n?n.length:0;if(0!==y)for(var A=0;A=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,M=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=M.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=M.return)&&n.call(M)}finally{if(o)throw o.error}}return i}function a(){for(var e=[],t=0;t2&&q("box");var n=R(t);return new Oe(e,W(n),n.name,!0,n.equals)},array:function(e,t){arguments.length>2&&q("array");var n=R(t);return Nn(e,W(n),n.name)},map:function(e,t){arguments.length>2&&q("map");var n=R(t);return new An(e,W(n),n.name)},set:function(e,t){arguments.length>2&&q("set");var n=R(t);return new pn(e,W(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&q("object");var r=R(n);if(!1===r.proxy)return jt({},e,t,r);var o=zt(r),M=jt({},void 0,void 0,r),i=nn(M);return Tt(i,e,t,o),i},ref:H,shallow:G,deep:Z,struct:V},F=function(e,t,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Z.apply(null,arguments);if(Ct(e))return e;var r=j(e)?F.object(e,t,n):Array.isArray(e)?F.array(e,t):f(e)?F.map(e,t):d(e)?F.set(e,t):e;if(r!==e)return r;N(!1)};function q(e){N("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(J).forEach((function(e){return F[e]=J[e]}));var X,K,$=U(!1,(function(e,t,n,r,M){var i=n.get,a=n.set,u=M[0]||{};wn(e).addComputedProp(e,t,o({get:i,set:a,context:e},u))})),ee=$({equals:h.structural}),te=function(e,t,n){if("string"==typeof t)return $.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return $.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new Le(r)};te.struct=ee,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(X||(X={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(K||(K={}));var ne=function(e){this.cause=e};function re(e){return e instanceof ne}function oe(e){switch(e.dependenciesState){case X.UP_TO_DATE:return!1;case X.NOT_TRACKING:case X.STALE:return!0;case X.POSSIBLY_STALE:for(var t=le(!0),n=ce(),r=e.observing,o=r.length,M=0;M0;Ue.computationDepth>0&&t&&N(!1),Ue.allowStateChanges||!t&&"strict"!==Ue.enforceActions||N(!1)}function ae(e,t,n){var r=le(!0);ge(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ue.runId;var o,M=Ue.trackingDerivation;if(Ue.trackingDerivation=e,!0===Ue.disableErrorBoundaries)o=t.call(n);else try{o=t.call(n)}catch(e){o=new ne(e)}return Ue.trackingDerivation=M,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=X.UP_TO_DATE,o=0,M=e.unboundDepsCount,i=0;ir&&(r=a.dependenciesState)}n.length=o,e.newObserving=null,M=t.length;for(;M--;){0===(a=t[M]).diffValue&&_e(a,e),a.diffValue=0}for(;o--;){var a;1===(a=n[o]).diffValue&&(a.diffValue=0,Be(a,e))}r!==X.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),De(r),o}function ue(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)_e(t[n],e);e.dependenciesState=X.NOT_TRACKING}function se(e){var t=ce();try{return e()}finally{Ne(t)}}function ce(){var e=Ue.trackingDerivation;return Ue.trackingDerivation=null,e}function Ne(e){Ue.trackingDerivation=e}function le(e){var t=Ue.allowStateReads;return Ue.allowStateReads=e,t}function De(e){Ue.allowStateReads=e}function ge(e){if(e.dependenciesState!==X.UP_TO_DATE){e.dependenciesState=X.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=X.UP_TO_DATE}}var ye=0,je=1,ze=Object.getOwnPropertyDescriptor((function(){}),"name");ze&&ze.configurable;function Te(e,t,n){var r=function(){return Ae(e,t,n||this,arguments)};return r.isMobxAction=!0,r}function Ae(e,t,n,r){var o=fe(e,n,r);try{return t.apply(n,r)}catch(e){throw o.error=e,e}finally{de(o)}}function fe(e,t,n){var r=0,o=ce();Re();var M={prevDerivation:o,prevAllowStateChanges:Ee(!0),prevAllowStateReads:le(!0),notifySpy:!1,startTime:r,actionId:je++,parentActionId:ye};return ye=M.actionId,M}function de(e){ye!==e.actionId&&N("invalid action stack. did you forget to finish an action?"),ye=e.parentActionId,void 0!==e.error&&(Ue.suppressReactionErrors=!0),Ie(e.prevAllowStateChanges),De(e.prevAllowStateReads),Ze(),Ne(e.prevDerivation),e.notifySpy,Ue.suppressReactionErrors=!1}function pe(e,t){var n,r=Ee(e);try{n=t()}finally{Ie(r)}return n}function Ee(e){var t=Ue.allowStateChanges;return Ue.allowStateChanges=e,t}function Ie(e){Ue.allowStateChanges=e}function we(e){var t,n=Ue.computationDepth;Ue.computationDepth=0;try{t=e()}finally{Ue.computationDepth=n}return t}var Oe=function(e){function t(t,n,r,o,M){void 0===r&&(r="ObservableValue@"+c()),void 0===o&&(o=!0),void 0===M&&(M=h.default);var i=e.call(this,r)||this;return i.enhancer=n,i.name=r,i.equals=M,i.hasUnreportedChange=!1,i.value=n(t,void 0,r),i}return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){this.value;if((e=this.prepareNewValue(e))!==Ue.UNCHANGED){0,this.setNewValue(e)}},t.prototype.prepareNewValue=function(e){if(ie(this),rn(this)){var t=Mn(this,{object:this,type:"update",newValue:e});if(!t)return Ue.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ue.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),an(this)&&sn(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return on(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),un(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return I(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(O),xe=T("ObservableValue",Oe),Le=function(){function e(e){this.dependenciesState=X.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=X.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+c(),this.value=new ne(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=K.NONE,l(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+c(),e.set&&(this.setter=Te(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?h.structural:h.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==X.UP_TO_DATE)return;e.lowestObserverState=X.POSSIBLY_STALE,e.observers.forEach((function(t){t.dependenciesState===X.UP_TO_DATE&&(t.dependenciesState=X.POSSIBLY_STALE,t.isTracing!==K.NONE&&He(t,e),t.onBecomeStale())}))}(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.get=function(){this.isComputing&&N("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ue.inBatch||0!==this.observers.size||this.keepAlive?(Ge(this),oe(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===X.STALE)return;e.lowestObserverState=X.STALE,e.observers.forEach((function(t){t.dependenciesState===X.POSSIBLY_STALE?t.dependenciesState=X.STALE:t.dependenciesState===X.UP_TO_DATE&&(e.lowestObserverState=X.UP_TO_DATE)}))}(this)):oe(this)&&(this.warnAboutUntrackedRead(),Re(),this.value=this.computeValue(!1),Ze());var e=this.value;if(re(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(re(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){l(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else l(!1,!1)},e.prototype.trackAndCompute=function(){var e=this.value,t=this.dependenciesState===X.NOT_TRACKING,n=this.computeValue(!0),r=t||re(e)||re(n)||!this.equals(e,n);return r&&(this.value=n),r},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Ue.computationDepth++,e)t=ae(this,this.derivation,this.scope);else if(!0===Ue.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ne(e)}return Ue.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(ue(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return at((function(){var M=n.get();if(!r||t){var i=ce();e({type:"update",object:n,newValue:M,oldValue:o}),Ne(i)}r=!1,o=M}))},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return I(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(),he=T("ComputedValue",Le),ve=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],be=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},ke={};function me(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:ke}var Ce=!0,Se=!1,Ue=function(){var e=me();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ce=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new be).version&&(Ce=!1),Ce?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new be):(setTimeout((function(){Se||N("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new be)}();function Ye(){return Ue}function Qe(){var e=new be;for(var t in e)-1===ve.indexOf(t)&&(Ue[t]=e[t]);Ue.allowStateChanges=!Ue.enforceActions}function Be(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function _e(e,t){e.observers.delete(t),0===e.observers.size&&Pe(e)}function Pe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ue.pendingUnobservations.push(e))}function Re(){Ue.inBatch++}function Ze(){if(0==--Ue.inBatch){Fe();for(var e=Ue.pendingUnobservations,t=0;t0&&Pe(e),!1)}function He(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===K.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)}))}(At(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Le?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var Ve=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+c()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=X.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+c(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=K.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ue.pendingReactions.push(this),Fe())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Re(),this._isScheduled=!1,oe(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(e){this.reportExceptionInDerivation(e)}}Ze()}},e.prototype.track=function(e){if(!this.isDisposed){Re();0,this._isRunning=!0;var t=ae(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ue(this),re(t)&&this.reportExceptionInDerivation(t.cause),Ze()}},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ue.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ue.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ue.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Re(),ue(this),Ze()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[w]=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),Wt(this,e)},e}();function We(e){return Ue.globalReactionErrorHandlers.push(e),function(){var t=Ue.globalReactionErrorHandlers.indexOf(e);t>=0&&Ue.globalReactionErrorHandlers.splice(t,1)}}var Je=function(e){return e()};function Fe(){Ue.inBatch>0||Ue.isRunningReactions||Je(qe)}function qe(){Ue.isRunningReactions=!0;for(var e=Ue.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r",e):2===arguments.length&&"function"==typeof t?Te(e,t):1===arguments.length&&"string"==typeof e?tt(e):!0!==r?tt(t).apply(null,arguments):void z(e,t,Te(e.name||t,n.value,this))};function ot(e,t){return Ae("string"==typeof e?e:e.name||"","function"==typeof e?e:t,this,void 0)}function Mt(e){return"function"==typeof e&&!0===e.isMobxAction}function it(e,t,n){z(e,t,Te(t,n.bind(e)))}function at(e,t){void 0===t&&(t=s);var n,r=t&&t.name||e.name||"Autorun@"+c();if(!t.scheduler&&!t.delay)n=new Ve(r,(function(){this.track(i)}),t.onError,t.requiresObservable);else{var o=st(t),M=!1;n=new Ve(r,(function(){M||(M=!0,o((function(){M=!1,n.isDisposed||n.track(i)})))}),t.onError,t.requiresObservable)}function i(){e(n)}return n.schedule(),n.getDisposer()}rt.bound=function(e,t,n,r){return!0===r?(it(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return it(this,t,n.value||n.initializer.call(this)),this[t]},set:et}:{enumerable:!1,configurable:!0,set:function(e){it(this,t,e)},get:function(){}}};var ut=function(e){return e()};function st(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:ut}function ct(e,t,n){void 0===n&&(n=s);var r,o,M,i=n.name||"Reaction@"+c(),a=rt(i,n.onError?(r=n.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){r.call(this,e)}}):t),u=!n.scheduler&&!n.delay,N=st(n),l=!0,D=!1,g=n.compareStructural?h.structural:n.equals||h.default,y=new Ve(i,(function(){l||u?j():D||(D=!0,N(j))}),n.onError,n.requiresObservable);function j(){if(D=!1,!y.isDisposed){var t=!1;y.track((function(){var n=e(y);t=l||!g(M,n),M=n})),l&&n.fireImmediately&&a(M,y),l||!0!==t||a(M,y),l&&(l=!1)}}return y.schedule(),y.getDisposer()}function Nt(e,t,n){return Dt("onBecomeObserved",e,t,n)}function lt(e,t,n){return Dt("onBecomeUnobserved",e,t,n)}function Dt(e,t,n,r){var o="function"==typeof r?bn(t,n):bn(t),M="function"==typeof r?r:n,i=e+"Listeners";return o[i]?o[i].add(M):o[i]=new Set([M]),"function"!=typeof o[e]?N(!1):function(){var e=o[i];e&&(e.delete(M),0===e.size&&delete o[i])}}function gt(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,M=e.reactionScheduler,i=e.reactionRequiresObservable,a=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Ue.pendingReactions.length||Ue.inBatch||Ue.isRunningReactions)&&N("isolateGlobalState should be called before MobX is running any reactions"),Se=!0,Ce&&(0==--me().__mobxInstanceCount&&(me().__mobxGlobals=void 0),Ue=new be)),void 0!==t){var u=void 0;switch(t){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:N("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Ue.enforceActions=u,Ue.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(Ue.computedRequiresReaction=!!n),void 0!==i&&(Ue.reactionRequiresObservable=!!i),void 0!==a&&(Ue.observableRequiresReaction=!!a,Ue.allowStateReads=!Ue.observableRequiresReaction),void 0!==r&&(Ue.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),Ue.disableErrorBoundaries=!!o),M&&Ke(M)}function yt(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,e),M=r.reduce((function(t,r){return r(n,e,t)}),o);M&&Object.defineProperty(n,e,M)};for(var o in t)r(o);return e}function jt(e,t,n,r){var o=zt(r=R(r));return S(e),wn(e,r.name,o.enhancer),t&&Tt(e,t,n,o),e}function zt(e){return e.defaultDecorator||(!1===e.deep?H:Z)}function Tt(e,t,n,r){var o,i;Re();try{var a=p(t);try{for(var u=M(a),s=u.next();!s.done;s=u.next()){var c=s.value,N=Object.getOwnPropertyDescriptor(t,c);0;var l=(n&&c in n?n[c]:N.get?$:r)(e,c,N,!0);l&&Object.defineProperty(e,c,l)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}finally{Ze()}}function At(e,t){return ft(bn(e,t))}function ft(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(ft)),r}function dt(e,t){return pt(bn(e,t))}function pt(e){var t={name:e.name};return function(e){return e.observers&&e.observers.size>0}(e)&&(t.observers=Array.from(function(e){return e.observers}(e)).map(pt)),t}var Et=0;function It(){this.message="FLOW_CANCELLED"}function wt(e){return e instanceof It}function Ot(e){1!==arguments.length&&N("Flow expects 1 argument and cannot be used as decorator");var t=e.name||"";return function(){var n,r=this,o=arguments,M=++Et,i=rt(t+" - runid: "+M+" - init",e).apply(r,o),a=void 0,u=new Promise((function(e,r){var o=0;function u(e){var n;a=void 0;try{n=rt(t+" - runid: "+M+" - yield "+o++,i.next).call(i,e)}catch(e){return r(e)}c(n)}function s(e){var n;a=void 0;try{n=rt(t+" - runid: "+M+" - yield "+o++,i.throw).call(i,e)}catch(e){return r(e)}c(n)}function c(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(a=Promise.resolve(t.value)).then(u,s);t.then(c,r)}n=r,u(void 0)}));return u.cancel=rt(t+" - runid: "+M+" - cancel",(function(){try{a&&xt(a);var e=i.return(void 0),t=Promise.resolve(e.value);t.then(g,g),xt(t),n(new It)}catch(e){n(e)}})),u}}function xt(e){"function"==typeof e.cancel&&e.cancel()}function Lt(e,t,n){var r;if(fn(e)||jn(e)||xe(e))r=kn(e);else{if(!vn(e))return N(!1);if("string"!=typeof t)return N(!1);r=kn(e,t)}return void 0!==r.dehancer?N(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})}function ht(e,t,n){return"function"==typeof n?function(e,t,n){return kn(e,t).intercept(n)}(e,t,n):function(e,t){return kn(e).intercept(t)}(e,t)}function vt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===vn(e))return!1;if(!e[w].values.has(t))return!1;var n=bn(e,t);return he(n)}return he(e)}function bt(e){return arguments.length>1?N(!1):vt(e)}function kt(e,t){return"string"!=typeof t?N(!1):vt(e,t)}function mt(e,t){return null!=e&&(void 0!==t?!!vn(e)&&e[w].values.has(t):vn(e)||!!e[w]||x(e)||Xe(e)||he(e))}function Ct(e){return 1!==arguments.length&&N(!1),mt(e)}function St(e,t){return"string"!=typeof t?N(!1):mt(e,t)}function Ut(e){return vn(e)?e[w].getKeys():fn(e)||En(e)?Array.from(e.keys()):jn(e)?e.map((function(e,t){return t})):N(!1)}function Yt(e){return vn(e)?Ut(e).map((function(t){return e[t]})):fn(e)?Ut(e).map((function(t){return e.get(t)})):En(e)?Array.from(e.values()):jn(e)?e.slice():N(!1)}function Qt(e){return vn(e)?Ut(e).map((function(t){return[t,e[t]]})):fn(e)?Ut(e).map((function(t){return[t,e.get(t)]})):En(e)?Array.from(e.entries()):jn(e)?e.map((function(e,t){return[t,e]})):N(!1)}function Bt(e,t,n){if(2!==arguments.length||En(e))if(vn(e)){var r=e[w],o=r.values.get(t);o?r.write(t,n):r.addObservableProp(t,n,r.defaultEnhancer)}else if(fn(e))e.set(t,n);else if(En(e))e.add(t);else{if(!jn(e))return N(!1);"number"!=typeof t&&(t=parseInt(t,10)),l(t>=0,"Not a valid index: '"+t+"'"),Re(),t>=e.length&&(e.length=t+1),e[t]=n,Ze()}else{Re();var M=t;try{for(var i in M)Bt(e,i,M[i])}finally{Ze()}}}function _t(e,t){if(vn(e))e[w].remove(t);else if(fn(e))e.delete(t);else if(En(e))e.delete(t);else{if(!jn(e))return N(!1);"number"!=typeof t&&(t=parseInt(t,10)),l(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}}function Pt(e,t){return vn(e)?kn(e).has(t):fn(e)||En(e)?e.has(t):jn(e)?t>=0&&t0}function on(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),D((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Mn(e,t){var n=ce();try{for(var r=a(e.interceptors||[]),o=0,M=r.length;o0}function un(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),D((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function sn(e,t){var n=ce(),r=e.changeListeners;if(r){for(var o=0,M=(r=r.slice()).length;o0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return on(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),un(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;ro?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=u),rn(this)){var M=Mn(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:n});if(!M)return u;t=M.removedCount,n=M.added}n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}));var i=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,i),this.dehanceValues(i)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,a([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&!1,o=an(this),M=o||r?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:n}:null;this.atom.reportChanged(),o&&sn(this,M)},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&!1,o=an(this),M=o||r?{object:this.proxy,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom.reportChanged(),o&&sn(this,M)},e}(),Dn={intercept:function(e){return this[w].intercept(e)},observe:function(e,t){return void 0===t&&(t=!1),this[w].observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[w];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var n=[],r=2;r-1&&(this.splice(n,1),!0)},get:function(e){var t=this[w];if(t){if(e=0&&r++}t=Un(t),n=Un(n);var u="[object Array]"===a;if(!u){if("object"!=typeof t||"object"!=typeof n)return!1;var s=t.constructor,c=n.constructor;if(s!==c&&!("function"==typeof s&&s instanceof s&&"function"==typeof c&&c instanceof c)&&"constructor"in t&&"constructor"in n)return!1}if(0===r)return!1;r<0&&(r=-1);M=M||[];var N=(o=o||[]).length;for(;N--;)if(o[N]===t)return M[N]===n;if(o.push(t),M.push(n),u){if((N=t.length)!==n.length)return!1;for(;N--;)if(!e(t[N],n[N],r-1,o,M))return!1}else{var l=Object.keys(t),D=void 0;if(N=l.length,Object.keys(n).length!==N)return!1;for(;N--;)if(D=l[N],!Yn(n,D)||!e(t[D],n[D],r-1,o,M))return!1}return o.pop(),M.pop(),!0}(e,t,n)}function Un(e){return jn(e)?e.slice():f(e)||fn(e)||d(e)||En(e)?Array.from(e.entries()):e}function Yn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Qn(e){return e[Symbol.iterator]=Bn,e}function Bn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$e,extras:{getDebugName:mn},$mobx:w})}.call(this,n(3))},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"observer",(function(){return A})),n.d(t,"Observer",(function(){return d})),n.d(t,"useStaticRendering",(function(){return g})),n.d(t,"connect",(function(){return x})),n.d(t,"inject",(function(){return O})),n.d(t,"Provider",(function(){return v}));var r=n(0),o=n(1);function M(e){return!(e.prototype&&e.prototype.render||r.Component.isPrototypeOf(e))}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.prefix,r=void 0===n?"":n,o=t.suffix,M=void 0===o?"":o,i=e.displayName||e.name||e.constructor&&e.constructor.name||"";return r+i+M}var a="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},u=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=e[t],o=T[t],M=r?!0===n?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;e[t]=M}function z(e,t){if(null==e||null==t||"object"!==(void 0===e?"undefined":a(e))||"object"!==(void 0===t?"undefined":a(t)))return e!==t;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(t[r]!==e[r])return!0;return!1}var T={componentWillMount:function(){var e=this;if(!0!==l){var t=i(this),n=!1,M=!1;N.call(this,"props"),N.call(this,"state");var a=this.render.bind(this),u=null,s=!1,c=function(e,t,n){s=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=y(!1,a,e,t,n)}catch(e){r=e}})),r)throw r;return o};this.render=function(){return(u=new o.Reaction(t+".render()",(function(){if(!s&&(s=!0,"function"==typeof e.componentWillReact&&e.componentWillReact(),!0!==e.__$mobxIsUnmounted)){var t=!0;try{M=!0,n||r.Component.prototype.forceUpdate.call(e),t=!1}finally{M=!1,t&&u.dispose()}}}))).reactComponent=e,c.$mobx=u,e.render=c,c(e.props,e.state,e.context)}}function N(e){var t=this[e],r=Object(o.createAtom)("reactive "+e);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:function(){return r.reportObserved(),t},set:function(e){!M&&z(t,e)?(t=e,n=!0,r.reportChanged(),n=!1):t=e}})}},componentWillUnmount:function(){!0!==l&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,t){return l&&D.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||z(this.props,e)}};function A(e){var t,n;if(arguments.length>1&&D.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===e.isMobxInjector&&D.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),M(e))return A((n=t=function(t){function n(){return u(this,n),N(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return c(n,t),s(n,[{key:"render",value:function(){return e.call(this,this.props,this.context)}}]),n}(r.Component),t.displayName=i(e),n));if(!e)throw new Error("Please pass a valid component to 'observer'");var o=e.prototype||e;return f(o),e.isMobXReactObserver=!0,e}function f(e){j(e,"componentWillMount",!0),j(e,"componentDidMount"),e.shouldComponentUpdate||(e.shouldComponentUpdate=T.shouldComponentUpdate)}var d=A((function(e){return e.children[0]()}));d.displayName="Observer";"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var p=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){var n,r,o,M,i,a,u,s;e.exports=(n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,M=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,a=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,s=u&&u(Object),function e(t,c,N){if("string"!=typeof c){if(s){var l=u(c);l&&l!==s&&e(t,l,N)}var D=M(c);i&&(D=D.concat(i(c)));for(var g=0;g1?Object(r.h)("div",null," ",t," "):t[0]}},{key:"getChildContext",value:function(){var e={},t=this.context.mobxStores;if(t)for(var n in t)e[n]=t[n];for(var r in this.props)L[r]||"suppressChangedStoreWarning"===r||(e[r]=this.props[r]);return{mobxStores:e}}},{key:"componentWillReceiveProps",value:function(e){if(Object.keys(e).length!==Object.keys(this.props).length&&h.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var t in e)L[t]||this.props[t]===e[t]||h.warn("MobX Provider: Provided store '"+t+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),t}(r.Component);if(!r.Component)throw new Error("mobx-preact requires Preact to be available")}.call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONHTTPError=t.TextHTTPError=t.HTTPError=t.getPagination=void 0;var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",n=arguments[1];i(this,e),this.apiURL=t,this.apiURL.match(/\/[^\/]?/)&&(this._sameOrigin=!0),this.defaultHeaders=n&&n.defaultHeaders||{}}return o(e,[{key:"headers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r({},this.defaultHeaders,{"Content-Type":"application/json"},e)}},{key:"parseJsonResponse",value:function(e){return e.json().then((function(t){if(!e.ok)return Promise.reject(new N(e,t));var n=(0,M.getPagination)(e);return n?{pagination:n,items:t}:t}))}},{key:"request",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.headers(n.headers||{});return this._sameOrigin&&(n.credentials=n.credentials||"same-origin"),fetch(this.apiURL+e,r({},n,{headers:o})).then((function(e){var n=e.headers.get("Content-Type");return n&&n.match(/json/)?t.parseJsonResponse(e):e.ok?e.text().then((function(e){})):e.text().then((function(t){return Promise.reject(new c(e,t))}))}))}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(0);function o(e){return(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})(e)}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.APIUrl,n=e.logo,o=void 0===n||n,i=e.namePlaceholder,N=e.locale;N&&(u.default.locale=N);var l=document.querySelectorAll("[data-netlify-identity-menu],[data-netlify-identity-button]");Array.prototype.slice.call(l).forEach((function(e){var t=null===e.getAttribute("data-netlify-identity-menu")?"button":"menu";(0,r.render)((0,r.h)(M.Provider,{store:u.default},(0,r.h)(s.default,{mode:t,text:e.innerText.trim()})),e,null)})),u.default.init(O(t)),u.default.modal.logo=o,u.default.setNamePlaceholder(i),(I=document.createElement("iframe")).id="netlify-identity-widget",I.title="Netlify identity widget",I.onload=function(){var e=I.contentDocument.createElement("style");e.innerHTML=c.default.toString(),I.contentDocument.head.appendChild(e),E=(0,r.render)((0,r.h)(M.Provider,{store:u.default},(0,r.h)(a.default,null)),I.contentDocument.body,E),b()},p(I,x),I.src="about:blank";var D=e.container?document.querySelector(e.container):document.body;D.appendChild(I),d&&(I.setAttribute("style",d),d=null)}(e)},setLocale:function(e){e&&(u.default.locale=e)},store:u.default},d=null;function p(e,t){var n="";for(var r in t)n+="".concat(r,": ").concat(t[r],"; ");e?e.setAttribute("style",n):d=n}var E,I,w={localhost:!0,"127.0.0.1":!0,"0.0.0.0":!0};function O(e){var t=w[document.location.hostname];if(e)return new i.default({APIUrl:e,setCookie:!t});if(t){u.default.setIsLocal(t);var n=localStorage.getItem("netlifySiteURL");return n&&u.default.setSiteURL(n),null}return new i.default({setCookie:!t})}var x={position:"fixed",top:0,left:0,border:"none",width:"100%",height:"100%",overflow:"visible",background:"transparent",display:"none","z-index":99};(0,o.observe)(u.default.modal,"isOpen",(function(){u.default.settings||u.default.loadSettings(),p(I,y(y({},x),{},{display:u.default.modal.isOpen?"block !important":"none"})),u.default.modal.isOpen?T("open",u.default.modal.page):T("close")})),(0,o.observe)(u.default,"siteURL",(function(){var e;if(null===u.default.siteURL||void 0===u.default.siteURL?localStorage.removeItem("netlifySiteURL"):localStorage.setItem("netlifySiteURL",u.default.siteURL),u.default.siteURL){var t=u.default.siteURL.replace(/\/$/,"");e="".concat(t,"/.netlify/identity")}u.default.init(O(e),!0)})),(0,o.observe)(u.default,"user",(function(){u.default.user?T("login",u.default.user):T("logout")})),(0,o.observe)(u.default,"gotrue",(function(){u.default.gotrue&&T("init",u.default.gotrue.currentUser())})),(0,o.observe)(u.default,"error",(function(){T("error",u.default.error)}));var L=/(confirmation|invite|recovery|email_change)_token=([^&]+)/,h=/error=access_denied&error_description=403/,v=/access_token=/;function b(){var e=(document.location.hash||"").replace(/^#\/?/,"");if(e){var t=e.match(L);if(t&&(u.default.verifyToken(t[1],t[2]),document.location.hash=""),e.match(h)&&(u.default.openModal("signup"),document.location.hash=""),e.match(v)){var n={};if(e.split("&").forEach((function(e){var t=l(e.split("="),2),r=t[0],o=t[1];n[r]=o})),document&&n.access_token&&(document.cookie="nf_jwt=".concat(n.access_token)),n.state)try{var r=decodeURIComponent(n.state);if("implicit"===JSON.parse(r).auth_type)return}catch(e){}document.location.hash="",u.default.openModal("login"),u.default.completeExternalLogin(n)}}}var k=f;t.default=k},function(e,t,n){"use strict";function r(e){return(r="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,M=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in e)if(Object.prototype.hasOwnProperty.call(e,M)){var i=o?Object.getOwnPropertyDescriptor(e,M):null;i&&(i.get||i.set)?Object.defineProperty(n,M,i):n[M]=e[M]}n.default=e,t&&t.set(e,n);return n}(n(4)),i=(o=n(12))&&o.__esModule?o:{default:o};function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.APIUrl,r=void 0===n?"/.netlify/identity":n,o=t.audience,i=void 0===o?"":o,a=t.setCookie,s=void 0!==a&&a;u(this,e),r.match(c)&&console.warn("Warning:\n\nDO NOT USE HTTP IN PRODUCTION FOR GOTRUE EVER!\nGoTrue REQUIRES HTTPS to work securely."),i&&(this.audience=i),this.setCookie=s,this.api=new M.default(r)}var t,n,r;return t=e,(n=[{key:"_request",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.headers=t.headers||{};var n=t.audience||this.audience;return n&&(t.headers["X-JWT-AUD"]=n),this.api.request(e,t).catch((function(e){return e instanceof M.JSONHTTPError&&e.json&&(e.json.msg?e.message=e.json.msg:e.json.error&&(e.message="".concat(e.json.error,": ").concat(e.json.error_description))),Promise.reject(e)}))}},{key:"settings",value:function(){return this._request("/settings")}},{key:"signup",value:function(e,t,n){return this._request("/signup",{method:"POST",body:JSON.stringify({email:e,password:t,data:n})})}},{key:"login",value:function(e,t,n){var r=this;return this._setRememberHeaders(n),this._request("/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"grant_type=password&username=".concat(encodeURIComponent(e),"&password=").concat(encodeURIComponent(t))}).then((function(e){return i.default.removeSavedSession(),r.createUser(e,n)}))}},{key:"loginExternalUrl",value:function(e){return"".concat(this.api.apiURL,"/authorize?provider=").concat(e)}},{key:"confirm",value:function(e,t){return this._setRememberHeaders(t),this.verify("signup",e,t)}},{key:"requestPasswordRecovery",value:function(e){return this._request("/recover",{method:"POST",body:JSON.stringify({email:e})})}},{key:"recover",value:function(e,t){return this._setRememberHeaders(t),this.verify("recovery",e,t)}},{key:"acceptInvite",value:function(e,t,n){var r=this;return this._setRememberHeaders(n),this._request("/verify",{method:"POST",body:JSON.stringify({token:e,password:t,type:"signup"})}).then((function(e){return r.createUser(e,n)}))}},{key:"acceptInviteExternalUrl",value:function(e,t){return"".concat(this.api.apiURL,"/authorize?provider=").concat(e,"&invite_token=").concat(t)}},{key:"createUser",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._setRememberHeaders(t);var n=new i.default(this.api,e,this.audience);return n.getUserData().then((function(e){return t&&e._saveSession(),e}))}},{key:"currentUser",value:function(){var e=i.default.recoverSession(this.api);return e&&this._setRememberHeaders(e._fromStorage),e}},{key:"verify",value:function(e,t,n){var r=this;return this._setRememberHeaders(n),this._request("/verify",{method:"POST",body:JSON.stringify({token:t,type:e})}).then((function(e){return r.createUser(e,n)}))}},{key:"_setRememberHeaders",value:function(e){this.setCookie&&(this.api.defaultHeaders=this.api.defaultHeaders||{},this.api.defaultHeaders["X-Use-Cookie"]=e?"1":"session")}}])&&s(t.prototype,n),r&&s(t,r),e}();t.default=N,"undefined"!=typeof window&&(window.GoTrue=N)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,M=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,M=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw M}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};t.getPagination=function(e){var t=e.headers.get("Link"),n={};if(null==t)return null;t=t.split(",");for(var o=e.headers.get("X-Total-Count"),M=0,i=t.length;M1&&void 0!==arguments[1]?arguments[1]:{};n.headers=n.headers||{};var r=n.audience||this.audience;return r&&(n.headers["X-JWT-AUD"]=r),this.jwt().then((function(r){return t.api.request(e,s({headers:Object.assign(n.headers,{Authorization:"Bearer ".concat(r)})},n)).catch((function(e){return e instanceof M.JSONHTTPError&&e.json&&(e.json.msg?e.message=e.json.msg:e.json.error&&(e.message="".concat(e.json.error,": ").concat(e.json.error_description))),Promise.reject(e)}))}))}},{key:"getUserData",value:function(){return this._request("/user").then(this._saveUserData.bind(this)).then(this._refreshSavedSession.bind(this))}},{key:"_saveUserData",value:function(t,n){for(var r in t)r in e.prototype||r in g||(this[r]=t[r]);return n&&(this._fromStorage=!0),this}},{key:"_processTokenResponse",value:function(e){var t;this.token=e;try{t=JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}var n=window.atob(t);try{return decodeURIComponent(escape(n))}catch(e){return n}}(e.access_token.split(".")[1])),this.token.expires_at=1e3*t.exp}catch(t){console.error(new Error("Gotrue-js: Failed to parse tokenResponse claims: ".concat(JSON.stringify(e))))}}},{key:"_refreshSavedSession",value:function(){return j()&&localStorage.getItem("gotrue.user")&&this._saveSession(),this}},{key:"_saveSession",value:function(){return j()&&localStorage.setItem("gotrue.user",JSON.stringify(this._details)),this}},{key:"tokenDetails",value:function(){return this.token}},{key:"clearSession",value:function(){e.removeSavedSession(),this.token=null,D=null}},{key:"admin",get:function(){return new i.default(this)}},{key:"_details",get:function(){var t={};for(var n in this)n in e.prototype||n in y||(t[n]=this[n]);return t}}])&&N(t.prototype,n),r&&N(t,r),e}();t.default=z},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return this.user._request("/admin/users/".concat(e.id),{method:"PUT",body:JSON.stringify(t)})}},{key:"createUser",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.email=e,n.password=t,this.user._request("/admin/users",{method:"POST",body:JSON.stringify(n)})}},{key:"deleteUser",value:function(e){return this.user._request("/admin/users/".concat(e.id),{method:"DELETE"})}}])&&r(t.prototype,n),o&&r(t,o),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=n(0),M=n(2),i=l(n(15)),a=l(n(16)),u=l(n(17)),s=l(n(18)),c=l(n(19)),N=l(n(6));function l(e){return e&&e.__esModule?e:{default:e}}function D(e){return(D="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})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"en",n=c[t]&&c[t][e];return n||c.en[e]||e}},function(e){e.exports=JSON.parse('{"log_in":"Log in","log_out":"Log out","logged_in_as":"Logged in as","logged_in":"Logged in","logging_in":"Logging in","logging_out":"Logging out","sign_up":"Sign up","signing_up":"Signing up","forgot_password":"Forgot password?","recover_password":"Recover password","send_recovery_email":"Send recovery email","sending_recovery_email":"Sending recovery email","never_mind":"Never mind","update_password":"Update password","updating_password":"Updating password","complete_your_signup":"Complete your signup","site_url_title":"Development Settings","site_url_link_text":"Clear localhost URL","site_url_message":"Looks like you\'re running a local server. Please let us know the URL of your Netlify site.","site_url_label":"Enter your Netlify Site URL","site_url_placeholder":"URL of your Netlify site","site_url_submit":"Set site\'s URL","message_confirm":"A confirmation message was sent to your email, click the link there to continue.","message_password_mail":"We\'ve sent a recovery email to your account, follow the link there to reset your password.","message_email_changed":"Your email address has been updated!","message_verfication_error":"There was an error verifying your account. Please try again or contact an administrator.","message_signup_disabled":"Public signups are disabled. Contact an administrator and ask for an invite.","form_name_placeholder":"Name","form_email_label":"Enter your email","form_name_label":"Enter your name","form_email_placeholder":"Email","form_password_label":"Enter your password","form_password_placeholder":"Password","coded_by":"Coded by Netlify","No user found with this email":"No user found with this email","Invalid Password":"Invalid Password","continue_with":"Continue with"}')},function(e){e.exports=JSON.parse('{"log_in":"Connexion","log_out":"Déconnexion","logged_in_as":"Connecté en tant que","logged_in":"Connecté","logging_in":"Connection","logging_out":"Déconnexion","sign_up":"Inscription","signing_up":"Inscription","forgot_password":"Mot de passe oublié ?","recover_password":"Récupérer le mot de passe","send_recovery_email":"Envoyer l\'e-mail de récupération","sending_recovery_email":"Envoi de l\'e-mail de récupération","never_mind":"Laisser tomber","update_password":"Mise à jour du mot de passe","updating_password":"Mise à jour du mot de passe","complete_your_signup":"Compléter l\'inscription","site_url_title":"Paramètres de développement","site_url_link_text":"Effacer l\'URL localhost","site_url_message":"On dirait que vous faites tourner un serveur local. Veuillez nous indiquer l\'URL de votre site Netlify.","site_url_label":"Entrez l\'URL de votre site Netlify","site_url_placeholder":"URL de votre site Netlify","site_url_submit":"Définir l\'URL du site","message_confirm":"Un message de confirmation a été envoyé à votre adresse électronique, cliquez sur le lien pour continuer.","message_password_mail":"Nous avons envoyé un e-mail de récupération à votre compte, suivez le lien qui s\'y trouve pour réinitialiser votre mot de passe.","message_email_changed":"Votre adresse e-mail a été mise à jour !","message_verfication_error":"Il y a eu une erreur lors de la vérification de votre compte. Veuillez réessayer ou contacter un administrateur.","message_signup_disabled":"Les inscriptions publiques sont désactivées. Contactez un administrateur et demandez une invitation.","form_name_placeholder":"Nom","form_email_label":"Entrez votre adresse e-mail","form_name_label":"Saisissez votre nom","form_email_placeholder":"E-mail","form_password_label":"Saisissez votre mot de passe","form_password_placeholder":"Mot de passe","coded_by":"Codé par Netlify","No user found with this email":"Aucun utilisateur trouvé avec cet e-mail","Invalid Password":"Mot de passe incorrect"}')},function(e){e.exports=JSON.parse('{"log_in":"Iniciar sesión","log_out":"Cerrar sesión","logged_in_as":"Conectado como","logged_in":"Conectado","logging_in":"Iniciando sesión","logging_out":"Cerrando sesión","sign_up":"Registrate","signing_up":"Registrandose","forgot_password":"¿Olvidaste tu contraseña?","recover_password":"Recuperar contraseña","send_recovery_email":"Enviar correo electrónico de recuperación","sending_recovery_email":"Enviando correo electrónico de recuperación","never_mind":"Regresar","update_password":"Actualizar contraseña","updating_password":"Actualizando contraseña","complete_your_signup":"Completa tu registro","site_url_title":"Configuración de desarrollo","site_url_link_text":"Borrar URL del localhost","site_url_message":"Parece que estas corriendo un servidor local. Por favor haznos saber la URL de tu sitio en Netlify.","site_url_label":"Ingresa la URL de tu sitio en Netlify","site_url_placeholder":"URL de tu sitio en Netlify","site_url_submit":"Establecer la URL del sitio","message_confirm":"Se envió un mensaje de confirmación a tu correo electrónico, haz clic en el enlace allí para continuar.","message_password_mail":"Hemos enviado un correo electrónico de recuperación a tu correo electrónico, sigue el enlace allí para restablecer tu contraseña.","message_email_changed":"¡Tu dirección de correo electrónico ha sido actualizada!","message_verfication_error":"Se produjo un error al verificar tu cuenta. Por favor intenta nuevamente o contacta a un administrador.","message_signup_disabled":"Los registros públicos están deshabilitados. Contacta a un administrador y solicita una invitación.","form_name_placeholder":"Nombre","form_email_label":"Ingresa tu correo electrónico","form_name_label":"Ingresa tu nombre","form_email_placeholder":"Correo electrónico","form_password_label":"Ingresa tu contraseña","form_password_placeholder":"Contraseña","coded_by":"Codificado por Netlify","No user found with this email":"No existe ningún usuario con este correo electrónico","Invalid Password":"La contraseña es invalida","continue_with":"Continúa con"}')},function(e){e.exports=JSON.parse('{"log_in":"Bejelentkezés","log_out":"Kijelentkezés","logged_in_as":"Bejelentkezve mint","logged_in":"Bejelentkezve","logging_in":"Bejelentkezés","logging_out":"Kijelentkezés","sign_up":"Regisztráció","signing_up":"Regisztrálás","forgot_password":"Elfelejtette a jelszavát?","recover_password":"Jelszó visszaállítása","send_recovery_email":"Jelszópótló levél küldése","sending_recovery_email":"Jelszópótló levél küldése","never_mind":"Mégsem","update_password":"Új jelszó beállítása","updating_password":"Új jelszó beállítása","complete_your_signup":"Regisztráció befejezése","site_url_title":"Fejlesztői Beállítások","site_url_link_text":"Localhost URL törlése","site_url_message":"Úgy néz ki egy helyi szervert futtat. Kérjük adja meg a Netlify oldala URL-jét.","site_url_label":"Adja meg a Netlify oldala URL-jét","site_url_placeholder":"a Netlify oldala URL-je","site_url_submit":"URL beállítása","message_confirm":"Elküldtünk egy megerősítő levelet e-mailben, kérjük kattintson a linkre a levélben a folytatáshoz.","message_password_mail":"Elküldtünk egy jelszópótló levelet e-mailben, kérjük kövesse a linket a levélben a jelszava visszaállításához.","message_email_changed":"Az e-mail címét frissítettük!","message_verfication_error":"Probléma történt a fiókja megerősítése közben. Kérjük próbálja újra, vagy vegye fel a kapcsolatot egy adminisztrátorral.","message_signup_disabled":"A nyilvános regisztráció nincs engedélyezve. Vegye fel a kapcsolatot egy adminisztrátorral és kérjen meghívót.","form_name_placeholder":"Név","form_email_label":"Adja meg az e-mail címét","form_name_label":"Adja meg a nevét","form_email_placeholder":"E-mail","form_password_label":"Adja meg a jelszavát","form_password_placeholder":"Jelszó","coded_by":"Fejlesztette a Netlify","No user found with this email":"Nem található fiók ezzel az e-mail címmel","Invalid Password":"Helytelen Jelszó","continue_with":"Bejelentkezés ezzel:"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=n(0);function M(e){return(M="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})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}}function h(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),M=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)M.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return M}function v(){for(var e=[],n=0;n2&&X("box");var t=Z(n);return new xe(e,J(t),t.name,!0,t.equals)},array:function(e,n){arguments.length>2&&X("array");var t=Z(n);return Nt(e,J(t),t.name)},map:function(e,n){arguments.length>2&&X("map");var t=Z(n);return new At(e,J(t),t.name)},set:function(e,n){arguments.length>2&&X("set");var t=Z(n);return new Et(e,J(t),t.name)},object:function(e,n,t){"string"==typeof arguments[1]&&X("object");var r=Z(t);if(!1===r.proxy)return Tn({},e,n,r);var o=fn(r),i=Tn({},void 0,void 0,r),M=ot(i);return An(M,e,n,o),M},ref:W,shallow:H,deep:G,struct:V},q=function(e,n,t){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return G.apply(null,arguments);if(Un(e))return e;var r=l(e)?q.object(e,n,t):Array.isArray(e)?q.array(e,n):y(e)?q.map(e,n):j(e)?q.set(e,n):e;if(r!==e)return r;M(!1)};function X(e){M("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(F).forEach((function(e){return q[e]=F[e]}));var K,$,ee=Y(!1,(function(e,n,t,r,o){var i=t.get,M=t.set,a=o[0]||{};Ot(e).addComputedProp(e,n,x({get:i,set:M,context:e},a))})),ne=ee({equals:I.structural}),te=function(e,n,t){if("string"==typeof n)return ee.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ee.apply(null,arguments);var r="object"==typeof n?n:{};return r.get=e,r.set="function"==typeof n?n:r.set,r.name=r.name||e.name||"",new he(r)};te.struct=ne,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(K||(K={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}($||($={}));var re=function(e){this.cause=e};function oe(e){return e instanceof re}function ie(e){switch(e.dependenciesState){case K.UP_TO_DATE:return!1;case K.NOT_TRACKING:case K.STALE:return!0;case K.POSSIBLY_STALE:for(var n=De(!0),t=le(),r=e.observing,o=r.length,i=0;i0;Ye.computationDepth>0&&n&&M(!1),Ye.allowStateChanges||!n&&"strict"!==Ye.enforceActions||M(!1)}function ue(e,n,t){var r=De(!0);ye(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ye.runId;var o,i=Ye.trackingDerivation;if(Ye.trackingDerivation=e,!0===Ye.disableErrorBoundaries)o=n.call(t);else try{o=n.call(t)}catch(e){o=new re(e)}return Ye.trackingDerivation=i,function(e){for(var n=e.observing,t=e.observing=e.newObserving,r=K.UP_TO_DATE,o=0,i=e.unboundDepsCount,M=0;Mr&&(r=a.dependenciesState)}t.length=o,e.newObserving=null,i=n.length;for(;i--;){0===(a=n[i]).diffValue&&Pe(a,e),a.diffValue=0}for(;o--;){var a;1===(a=t[o]).diffValue&&(a.diffValue=0,Be(a,e))}r!==K.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),ge(r),o}function se(e){var n=e.observing;e.observing=[];for(var t=n.length;t--;)Pe(n[t],e);e.dependenciesState=K.NOT_TRACKING}function ce(e){var n=le();try{return e()}finally{Ne(n)}}function le(){var e=Ye.trackingDerivation;return Ye.trackingDerivation=null,e}function Ne(e){Ye.trackingDerivation=e}function De(e){var n=Ye.allowStateReads;return Ye.allowStateReads=e,n}function ge(e){Ye.allowStateReads=e}function ye(e){if(e.dependenciesState!==K.UP_TO_DATE){e.dependenciesState=K.UP_TO_DATE;for(var n=e.observing,t=n.length;t--;)n[t].lowestObserverState=K.UP_TO_DATE}}var je=0,ze=1,Te=Object.getOwnPropertyDescriptor((function(){}),"name");Te&&Te.configurable;function fe(e,n,t){var r=function(){return Ae(e,n,t||this,arguments)};return r.isMobxAction=!0,r}function Ae(e,n,t,r){var o=de(e,t,r);try{return n.apply(t,r)}catch(e){throw o.error=e,e}finally{pe(o)}}function de(e,n,t){var r=0,o=le();Ze();var i={prevDerivation:o,prevAllowStateChanges:we(!0),prevAllowStateReads:De(!0),notifySpy:!1,startTime:r,actionId:ze++,parentActionId:je};return je=i.actionId,i}function pe(e){je!==e.actionId&&M("invalid action stack. did you forget to finish an action?"),je=e.parentActionId,void 0!==e.error&&(Ye.suppressReactionErrors=!0),Ie(e.prevAllowStateChanges),ge(e.prevAllowStateReads),Ge(),Ne(e.prevDerivation),e.notifySpy,Ye.suppressReactionErrors=!1}function Ee(e,n){var t,r=we(e);try{t=n()}finally{Ie(r)}return t}function we(e){var n=Ye.allowStateChanges;return Ye.allowStateChanges=e,n}function Ie(e){Ye.allowStateChanges=e}function Oe(e){var n,t=Ye.computationDepth;Ye.computationDepth=0;try{n=e()}finally{Ye.computationDepth=t}return n}var xe=function(e){function n(n,t,r,o,M){void 0===r&&(r="ObservableValue@"+i()),void 0===o&&(o=!0),void 0===M&&(M=I.default);var a=e.call(this,r)||this;return a.enhancer=t,a.name=r,a.equals=M,a.hasUnreportedChange=!1,a.value=t(n,void 0,r),a}return function(e,n){function t(){this.constructor=e}O(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}(n,e),n.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.prototype.set=function(e){this.value;if((e=this.prepareNewValue(e))!==Ye.UNCHANGED){0,this.setNewValue(e)}},n.prototype.prepareNewValue=function(e){if(ae(this),it(this)){var n=at(this,{object:this,type:"update",newValue:e});if(!n)return Ye.UNCHANGED;e=n.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ye.UNCHANGED:e},n.prototype.setNewValue=function(e){var n=this.value;this.value=e,this.reportChanged(),ut(this)&&ct(this,{type:"update",object:this,newValue:e,oldValue:n})},n.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},n.prototype.intercept=function(e){return Mt(this,e)},n.prototype.observe=function(e,n){return n&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),st(this,e)},n.prototype.toJSON=function(){return this.get()},n.prototype.toString=function(){return this.name+"["+this.value+"]"},n.prototype.valueOf=function(){return f(this.get())},n.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},n}(p),Le=D("ObservableValue",xe),he=function(){function e(e){this.dependenciesState=K.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=K.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+i(),this.value=new re(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=$.NONE,a(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+i(),e.set&&(this.setter=fe(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?I.structural:I.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==K.UP_TO_DATE)return;e.lowestObserverState=K.POSSIBLY_STALE,e.observers.forEach((function(n){n.dependenciesState===K.UP_TO_DATE&&(n.dependenciesState=K.POSSIBLY_STALE,n.isTracing!==$.NONE&&We(n,e),n.onBecomeStale())}))}(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.get=function(){this.isComputing&&M("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ye.inBatch||0!==this.observers.size||this.keepAlive?(He(this),ie(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===K.STALE)return;e.lowestObserverState=K.STALE,e.observers.forEach((function(n){n.dependenciesState===K.POSSIBLY_STALE?n.dependenciesState=K.STALE:n.dependenciesState===K.UP_TO_DATE&&(e.lowestObserverState=K.UP_TO_DATE)}))}(this)):ie(this)&&(this.warnAboutUntrackedRead(),Ze(),this.value=this.computeValue(!1),Ge());var e=this.value;if(oe(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(oe(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){a(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else a(!1,!1)},e.prototype.trackAndCompute=function(){var e=this.value,n=this.dependenciesState===K.NOT_TRACKING,t=this.computeValue(!0),r=n||oe(e)||oe(t)||!this.equals(e,t);return r&&(this.value=t),r},e.prototype.computeValue=function(e){var n;if(this.isComputing=!0,Ye.computationDepth++,e)n=ue(this,this.derivation,this.scope);else if(!0===Ye.disableErrorBoundaries)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(e){n=new re(e)}return Ye.computationDepth--,this.isComputing=!1,n},e.prototype.suspend=function(){this.keepAlive||(se(this),this.value=void 0)},e.prototype.observe=function(e,n){var t=this,r=!0,o=void 0;return sn((function(){var i=t.get();if(!r||n){var M=le();e({type:"update",object:t,newValue:i,oldValue:o}),Ne(M)}r=!1,o=i}))},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return f(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(),ve=D("ComputedValue",he),me=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],be=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},ke={};function Ce(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:ke}var Se=!0,Ue=!1,Ye=function(){var e=Ce();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Se=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new be).version&&(Se=!1),Se?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new be):(setTimeout((function(){Ue||M("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new be)}();function Qe(){return Ye}function _e(){var e=new be;for(var n in e)-1===me.indexOf(n)&&(Ye[n]=e[n]);Ye.allowStateChanges=!Ye.enforceActions}function Be(e,n){e.observers.add(n),e.lowestObserverState>n.dependenciesState&&(e.lowestObserverState=n.dependenciesState)}function Pe(e,n){e.observers.delete(n),0===e.observers.size&&Re(e)}function Re(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ye.pendingUnobservations.push(e))}function Ze(){Ye.inBatch++}function Ge(){if(0==--Ye.inBatch){qe();for(var e=Ye.pendingUnobservations,n=0;n0&&Re(e),!1)}function We(e,n){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+n.name+"'"),e.isTracing===$.BREAK){var t=[];!function e(n,t,r){if(t.length>=1e3)return void t.push("(and many more)");t.push(""+new Array(r).join("\t")+n.name),n.dependencies&&n.dependencies.forEach((function(n){return e(n,t,r+1)}))}(dn(e),t,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+n.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof he?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+t.join("\n")+"\n*/\n ")()}}var Ve=function(){function e(e,n,t,r){void 0===e&&(e="Reaction@"+i()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=n,this.errorHandler=t,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=K.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+i(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=$.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ye.pendingReactions.push(this),qe())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Ze(),this._isScheduled=!1,ie(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(e){this.reportExceptionInDerivation(e)}}Ge()}},e.prototype.track=function(e){if(!this.isDisposed){Ze();0,this._isRunning=!0;var n=ue(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&se(this),oe(n)&&this.reportExceptionInDerivation(n.cause),Ge()}},e.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ye.disableErrorBoundaries)throw e;var t="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ye.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(t,e),Ye.globalReactionErrorHandlers.forEach((function(t){return t(e,n)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ze(),se(this),Ge()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[d]=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),Fn(this,e)},e}();function Je(e){return Ye.globalReactionErrorHandlers.push(e),function(){var n=Ye.globalReactionErrorHandlers.indexOf(e);n>=0&&Ye.globalReactionErrorHandlers.splice(n,1)}}var Fe=function(e){return e()};function qe(){Ye.inBatch>0||Ye.isRunningReactions||Fe(Xe)}function Xe(){Ye.isRunningReactions=!0;for(var e=Ye.pendingReactions,n=0;e.length>0;){100==++n&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var t=e.splice(0),r=0,o=t.length;r",e):2===arguments.length&&"function"==typeof n?fe(e,n):1===arguments.length&&"string"==typeof e?tn(e):!0!==r?tn(n).apply(null,arguments):void N(e,n,fe(e.name||n,t.value,this))};function Mn(e,n){return Ae("string"==typeof e?e:e.name||"","function"==typeof e?e:n,this,void 0)}function an(e){return"function"==typeof e&&!0===e.isMobxAction}function un(e,n,t){N(e,n,fe(n,t.bind(e)))}function sn(e,n){void 0===n&&(n=o);var t,r=n&&n.name||e.name||"Autorun@"+i();if(!n.scheduler&&!n.delay)t=new Ve(r,(function(){this.track(u)}),n.onError,n.requiresObservable);else{var M=ln(n),a=!1;t=new Ve(r,(function(){a||(a=!0,M((function(){a=!1,t.isDisposed||t.track(u)})))}),n.onError,n.requiresObservable)}function u(){e(t)}return t.schedule(),t.getDisposer()}on.bound=function(e,n,t,r){return!0===r?(un(e,n,t.value),null):t?{configurable:!0,enumerable:!1,get:function(){return un(this,n,t.value||t.initializer.call(this)),this[n]},set:nn}:{enumerable:!1,configurable:!0,set:function(e){un(this,n,e)},get:function(){}}};var cn=function(e){return e()};function ln(e){return e.scheduler?e.scheduler:e.delay?function(n){return setTimeout(n,e.delay)}:cn}function Nn(e,n,t){void 0===t&&(t=o);var r,M,a,u=t.name||"Reaction@"+i(),s=on(u,t.onError?(r=t.onError,M=n,function(){try{return M.apply(this,arguments)}catch(e){r.call(this,e)}}):n),c=!t.scheduler&&!t.delay,l=ln(t),N=!0,D=!1,g=t.compareStructural?I.structural:t.equals||I.default,y=new Ve(u,(function(){N||c?j():D||(D=!0,l(j))}),t.onError,t.requiresObservable);function j(){if(D=!1,!y.isDisposed){var n=!1;y.track((function(){var t=e(y);n=N||!g(a,t),a=t})),N&&t.fireImmediately&&s(a,y),N||!0!==n||s(a,y),N&&(N=!1)}}return y.schedule(),y.getDisposer()}function Dn(e,n,t){return yn("onBecomeObserved",e,n,t)}function gn(e,n,t){return yn("onBecomeUnobserved",e,n,t)}function yn(e,n,t,r){var o="function"==typeof r?bt(n,t):bt(n),i="function"==typeof r?r:t,a=e+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[e]?M(!1):function(){var e=o[a];e&&(e.delete(i),0===e.size&&delete o[a])}}function jn(e){var n=e.enforceActions,t=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,i=e.reactionScheduler,a=e.reactionRequiresObservable,u=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Ye.pendingReactions.length||Ye.inBatch||Ye.isRunningReactions)&&M("isolateGlobalState should be called before MobX is running any reactions"),Ue=!0,Se&&(0==--Ce().__mobxInstanceCount&&(Ce().__mobxGlobals=void 0),Ye=new be)),void 0!==n){var s=void 0;switch(n){case!0:case"observed":s=!0;break;case!1:case"never":s=!1;break;case"strict":case"always":s="strict";break;default:M("Invalid value for 'enforceActions': '"+n+"', expected 'never', 'always' or 'observed'")}Ye.enforceActions=s,Ye.allowStateChanges=!0!==s&&"strict"!==s}void 0!==t&&(Ye.computedRequiresReaction=!!t),void 0!==a&&(Ye.reactionRequiresObservable=!!a),void 0!==u&&(Ye.observableRequiresReaction=!!u,Ye.allowStateReads=!Ye.observableRequiresReaction),void 0!==r&&(Ye.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),Ye.disableErrorBoundaries=!!o),i&&$e(i)}function zn(e,n){var t="function"==typeof e?e.prototype:e,r=function(e){var r=n[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(t,e),i=r.reduce((function(n,r){return r(t,e,n)}),o);i&&Object.defineProperty(t,e,i)};for(var o in n)r(o);return e}function Tn(e,n,t,r){var o=fn(r=Z(r));return U(e),Ot(e,r.name,o.enhancer),n&&An(e,n,t,o),e}function fn(e){return e.defaultDecorator||(!1===e.deep?W:G)}function An(e,n,t,r){var o,i;Ze();try{var M=A(n);try{for(var a=L(M),u=a.next();!u.done;u=a.next()){var s=u.value,c=Object.getOwnPropertyDescriptor(n,s);0;var l=(t&&s in t?t[s]:c.get?ee:r)(e,s,c,!0);l&&Object.defineProperty(e,s,l)}}catch(e){o={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}finally{Ge()}}function dn(e,n){return pn(bt(e,n))}function pn(e){var n,t,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(n=e.observing,t=[],n.forEach((function(e){-1===t.indexOf(e)&&t.push(e)})),t).map(pn)),r}function En(e,n){return wn(bt(e,n))}function wn(e){var n={name:e.name};return function(e){return e.observers&&e.observers.size>0}(e)&&(n.observers=Array.from(function(e){return e.observers}(e)).map(wn)),n}var In=0;function On(){this.message="FLOW_CANCELLED"}function xn(e){return e instanceof On}function Ln(e){1!==arguments.length&&M("Flow expects 1 argument and cannot be used as decorator");var n=e.name||"";return function(){var t,r=this,o=arguments,i=++In,M=on(n+" - runid: "+i+" - init",e).apply(r,o),a=void 0,u=new Promise((function(e,r){var o=0;function u(e){var t;a=void 0;try{t=on(n+" - runid: "+i+" - yield "+o++,M.next).call(M,e)}catch(e){return r(e)}c(t)}function s(e){var t;a=void 0;try{t=on(n+" - runid: "+i+" - yield "+o++,M.throw).call(M,e)}catch(e){return r(e)}c(t)}function c(n){if(!n||"function"!=typeof n.then)return n.done?e(n.value):(a=Promise.resolve(n.value)).then(u,s);n.then(c,r)}t=r,u(void 0)}));return u.cancel=on(n+" - runid: "+i+" - cancel",(function(){try{a&&hn(a);var e=M.return(void 0),n=Promise.resolve(e.value);n.then(s,s),hn(n),t(new On)}catch(e){t(e)}})),u}}function hn(e){"function"==typeof e.cancel&&e.cancel()}function vn(e,n,t){var r;if(dt(e)||zt(e)||Le(e))r=kt(e);else{if(!mt(e))return M(!1);if("string"!=typeof n)return M(!1);r=kt(e,n)}return void 0!==r.dehancer?M(!1):(r.dehancer="function"==typeof n?n:t,function(){r.dehancer=void 0})}function mn(e,n,t){return"function"==typeof t?function(e,n,t){return kt(e,n).intercept(t)}(e,n,t):function(e,n){return kt(e).intercept(n)}(e,n)}function bn(e,n){if(null==e)return!1;if(void 0!==n){if(!1===mt(e))return!1;if(!e[d].values.has(n))return!1;var t=bt(e,n);return ve(t)}return ve(e)}function kn(e){return arguments.length>1?M(!1):bn(e)}function Cn(e,n){return"string"!=typeof n?M(!1):bn(e,n)}function Sn(e,n){return null!=e&&(void 0!==n?!!mt(e)&&e[d].values.has(n):mt(e)||!!e[d]||E(e)||Ke(e)||ve(e))}function Un(e){return 1!==arguments.length&&M(!1),Sn(e)}function Yn(e,n){return"string"!=typeof n?M(!1):Sn(e,n)}function Qn(e){return mt(e)?e[d].getKeys():dt(e)||wt(e)?Array.from(e.keys()):zt(e)?e.map((function(e,n){return n})):M(!1)}function _n(e){return mt(e)?Qn(e).map((function(n){return e[n]})):dt(e)?Qn(e).map((function(n){return e.get(n)})):wt(e)?Array.from(e.values()):zt(e)?e.slice():M(!1)}function Bn(e){return mt(e)?Qn(e).map((function(n){return[n,e[n]]})):dt(e)?Qn(e).map((function(n){return[n,e.get(n)]})):wt(e)?Array.from(e.entries()):zt(e)?e.map((function(e,n){return[n,e]})):M(!1)}function Pn(e,n,t){if(2!==arguments.length||wt(e))if(mt(e)){var r=e[d],o=r.values.get(n);o?r.write(n,t):r.addObservableProp(n,t,r.defaultEnhancer)}else if(dt(e))e.set(n,t);else if(wt(e))e.add(n);else{if(!zt(e))return M(!1);"number"!=typeof n&&(n=parseInt(n,10)),a(n>=0,"Not a valid index: '"+n+"'"),Ze(),n>=e.length&&(e.length=n+1),e[n]=t,Ge()}else{Ze();var i=n;try{for(var u in i)Pn(e,u,i[u])}finally{Ge()}}}function Rn(e,n){if(mt(e))e[d].remove(n);else if(dt(e))e.delete(n);else if(wt(e))e.delete(n);else{if(!zt(e))return M(!1);"number"!=typeof n&&(n=parseInt(n,10)),a(n>=0,"Not a valid index: '"+n+"'"),e.splice(n,1)}}function Zn(e,n){return mt(e)?kt(e).has(n):dt(e)||wt(e)?e.has(n):zt(e)?n>=0&&n0}function Mt(e,n){var t=e.interceptors||(e.interceptors=[]);return t.push(n),u((function(){var e=t.indexOf(n);-1!==e&&t.splice(e,1)}))}function at(e,n){var t=le();try{for(var r=v(e.interceptors||[]),o=0,i=r.length;o0}function st(e,n){var t=e.changeListeners||(e.changeListeners=[]);return t.push(n),u((function(){var e=t.indexOf(n);-1!==e&&t.splice(e,1)}))}function ct(e,n){var t=le(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return Mt(this,e)},e.prototype.observe=function(e,n){return void 0===n&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),st(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var t=new Array(e-n),r=0;ri?e=i:e<0&&(e=Math.max(0,i+e)),n=1===arguments.length?i-e:null==n?0:Math.max(0,Math.min(n,i-e)),void 0===t&&(t=r),it(this)){var M=at(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:t});if(!M)return r;n=M.removedCount,t=M.added}t=0===t.length?t:t.map((function(e){return o.enhancer(e,void 0)}));var a=this.spliceItemsIntoValues(e,n,t);return 0===n&&0===t.length||this.notifyArraySplice(e,t,a),this.dehanceValues(a)},e.prototype.spliceItemsIntoValues=function(e,n,t){var r;if(t.length<1e4)return(r=this.values).splice.apply(r,v([e,n],t));var o=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(t,this.values.slice(e+n)),o},e.prototype.notifyArrayChildUpdate=function(e,n,t){var r=!this.owned&&!1,o=ut(this),i=o||r?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:t}:null;this.atom.reportChanged(),o&&ct(this,i)},e.prototype.notifyArraySplice=function(e,n,t){var r=!this.owned&&!1,o=ut(this),i=o||r?{object:this.proxy,type:"splice",index:e,removed:t,added:n,removedCount:t.length,addedCount:n.length}:null;this.atom.reportChanged(),o&&ct(this,i)},e}(),gt={intercept:function(e){return this[d].intercept(e)},observe:function(e,n){return void 0===n&&(n=!1),this[d].observe(e,n)},clear:function(){return this.splice(0)},replace:function(e){var n=this[d];return n.spliceWithArray(0,n.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,n){for(var t=[],r=2;r-1&&(this.splice(t,1),!0)},get:function(e){var n=this[d];if(n){if(e=0&&r++}n=Yt(n),t=Yt(t);var u="[object Array]"===a;if(!u){if("object"!=typeof n||"object"!=typeof t)return!1;var s=n.constructor,c=t.constructor;if(s!==c&&!("function"==typeof s&&s instanceof s&&"function"==typeof c&&c instanceof c)&&"constructor"in n&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1);i=i||[];var l=(o=o||[]).length;for(;l--;)if(o[l]===n)return i[l]===t;if(o.push(n),i.push(t),u){if((l=n.length)!==t.length)return!1;for(;l--;)if(!e(n[l],t[l],r-1,o,i))return!1}else{var N=Object.keys(n),D=void 0;if(l=N.length,Object.keys(t).length!==l)return!1;for(;l--;)if(D=N[l],!Qt(t,D)||!e(n[D],t[D],r-1,o,i))return!1}return o.pop(),i.pop(),!0}(e,n,t)}function Yt(e){return zt(e)?e.slice():y(e)||dt(e)||j(e)||wt(e)?Array.from(e.entries()):e}function Qt(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function _t(e){return e[Symbol.iterator]=Bt,e}function Bt(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:en,extras:{getDebugName:Ct},$mobx:d})}.call(this,t(3))},function(e,n,t){"use strict";t.r(n),function(e){t.d(n,"observer",(function(){return f})),t.d(n,"Observer",(function(){return d})),t.d(n,"useStaticRendering",(function(){return g})),t.d(n,"connect",(function(){return x})),t.d(n,"inject",(function(){return O})),t.d(n,"Provider",(function(){return v}));var r=t(0),o=t(1);function i(e){return!(e.prototype&&e.prototype.render||r.Component.isPrototypeOf(e))}function M(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.prefix,r=void 0===t?"":t,o=n.suffix,i=void 0===o?"":o,M=e.displayName||e.name||e.constructor&&e.constructor.name||"";return r+M+i}var a="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},u=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},s=function(){function e(e,n){for(var t=0;t2&&void 0!==arguments[2]&&arguments[2],r=e[n],o=T[n],i=r?!0===t?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;e[n]=i}function z(e,n){if(null==e||null==n||"object"!==(void 0===e?"undefined":a(e))||"object"!==(void 0===n?"undefined":a(n)))return e!==n;var t=Object.keys(e);if(t.length!==Object.keys(n).length)return!0;for(var r=void 0,o=t.length-1;r=t[o];o--)if(n[r]!==e[r])return!0;return!1}var T={componentWillMount:function(){var e=this;if(!0!==N){var n=M(this),t=!1,i=!1;l.call(this,"props"),l.call(this,"state");var a=this.render.bind(this),u=null,s=!1,c=function(e,n,t){s=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=y(!1,a,e,n,t)}catch(e){r=e}})),r)throw r;return o};this.render=function(){return(u=new o.Reaction(n+".render()",(function(){if(!s&&(s=!0,"function"==typeof e.componentWillReact&&e.componentWillReact(),!0!==e.__$mobxIsUnmounted)){var n=!0;try{i=!0,t||r.Component.prototype.forceUpdate.call(e),n=!1}finally{i=!1,n&&u.dispose()}}}))).reactComponent=e,c.$mobx=u,e.render=c,c(e.props,e.state,e.context)}}function l(e){var n=this[e],r=Object(o.createAtom)("reactive "+e);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:function(){return r.reportObserved(),n},set:function(e){!i&&z(n,e)?(n=e,t=!0,r.reportChanged(),t=!1):n=e}})}},componentWillUnmount:function(){!0!==N&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return N&&D.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==n||z(this.props,e)}};function f(e){var n,t;if(arguments.length>1&&D.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===e.isMobxInjector&&D.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),i(e))return f((t=n=function(n){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return c(t,n),s(t,[{key:"render",value:function(){return e.call(this,this.props,this.context)}}]),t}(r.Component),n.displayName=M(e),t));if(!e)throw new Error("Please pass a valid component to 'observer'");var o=e.prototype||e;return A(o),e.isMobXReactObserver=!0,e}function A(e){j(e,"componentWillMount",!0),j(e,"componentDidMount"),e.shouldComponentUpdate||(e.shouldComponentUpdate=T.shouldComponentUpdate)}var d=f((function(e){return e.children[0]()}));d.displayName="Observer";"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var p=function(e,n){return e(n={exports:{}},n.exports),n.exports}((function(e,n){var t,r,o,i,M,a,u,s;e.exports=(t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,i=Object.getOwnPropertyNames,M=Object.getOwnPropertySymbols,a=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,s=u&&u(Object),function e(n,c,l){if("string"!=typeof c){if(s){var N=u(c);N&&N!==s&&e(n,N,l)}var D=i(c);M&&(D=D.concat(M(c)));for(var g=0;g1?Object(r.h)("div",null," ",n," "):n[0]}},{key:"getChildContext",value:function(){var e={},n=this.context.mobxStores;if(n)for(var t in n)e[t]=n[t];for(var r in this.props)L[r]||"suppressChangedStoreWarning"===r||(e[r]=this.props[r]);return{mobxStores:e}}},{key:"componentWillReceiveProps",value:function(e){if(Object.keys(e).length!==Object.keys(this.props).length&&h.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var n in e)L[n]||this.props[n]===e[n]||h.warn("MobX Provider: Provided store '"+n+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),n}(r.Component);if(!r.Component)throw new Error("mobx-preact requires Preact to be available")}.call(this,t(3))},function(e,n){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.JSONHTTPError=n.TextHTTPError=n.HTTPError=n.getPagination=void 0;var r=Object.assign||function(e){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];M(this,e),this.apiURL=n,this.apiURL.match(/\/[^\/]?/)&&(this._sameOrigin=!0),this.defaultHeaders=t&&t.defaultHeaders||{}}return o(e,[{key:"headers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r({},this.defaultHeaders,{"Content-Type":"application/json"},e)}},{key:"parseJsonResponse",value:function(e){return e.json().then((function(n){if(!e.ok)return Promise.reject(new l(e,n));var t=(0,i.getPagination)(e);return t?{pagination:t,items:n}:n}))}},{key:"request",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.headers(t.headers||{});return this._sameOrigin&&(t.credentials=t.credentials||"same-origin"),fetch(this.apiURL+e,r({},t,{headers:o})).then((function(e){var t=e.headers.get("Content-Type");return t&&t.match(/json/)?n.parseJsonResponse(e):e.ok?e.text().then((function(e){})):e.text().then((function(n){return Promise.reject(new c(e,n))}))}))}}]),e}();n.default=N},function(e,n,t){"use strict";function r(e){return(r="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})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t(0);function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function M(e,n){for(var t=0;te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&void 0!==arguments[0]?arguments[0]:{},n=e.APIUrl,t=e.logo,o=void 0===t||t,M=e.namePlaceholder,l=e.locale;l&&(u.default.locale=l);var N=document.querySelectorAll("[data-netlify-identity-menu],[data-netlify-identity-button]");Array.prototype.slice.call(N).forEach((function(e){var n=null===e.getAttribute("data-netlify-identity-menu")?"button":"menu";(0,r.render)((0,r.h)(i.Provider,{store:u.default},(0,r.h)(s.default,{mode:n,text:e.innerText.trim()})),e,null)})),u.default.init(O(n)),u.default.modal.logo=o,u.default.setNamePlaceholder(M),(w=document.createElement("iframe")).id="netlify-identity-widget",w.title="Netlify identity widget",w.onload=function(){var e=w.contentDocument.createElement("style");e.innerHTML=c.default.toString(),w.contentDocument.head.appendChild(e),E=(0,r.render)((0,r.h)(i.Provider,{store:u.default},(0,r.h)(a.default,null)),w.contentDocument.body,E),m()},p(w,x),w.src="about:blank";var D=e.container?document.querySelector(e.container):document.body;D.appendChild(w),d&&(w.setAttribute("style",d),d=null)}(e)},setLocale:function(e){e&&(u.default.locale=e)},store:u.default},d=null;function p(e,n){var t="";for(var r in n)t+="".concat(r,": ").concat(n[r],"; ");e?e.setAttribute("style",t):d=t}var E,w,I={localhost:!0,"127.0.0.1":!0,"0.0.0.0":!0};function O(e){var n=I[document.location.hostname];if(e)return new M.default({APIUrl:e,setCookie:!n});if(n){u.default.setIsLocal(n);var t=localStorage.getItem("netlifySiteURL");return t&&u.default.setSiteURL(t),null}return new M.default({setCookie:!n})}var x={position:"fixed",top:0,left:0,border:"none",width:"100%",height:"100%",overflow:"visible",background:"transparent",display:"none","z-index":99};(0,o.observe)(u.default.modal,"isOpen",(function(){u.default.settings||u.default.loadSettings(),p(w,y(y({},x),{},{display:u.default.modal.isOpen?"block !important":"none"})),u.default.modal.isOpen?T("open",u.default.modal.page):T("close")})),(0,o.observe)(u.default,"siteURL",(function(){var e;if(null===u.default.siteURL||void 0===u.default.siteURL?localStorage.removeItem("netlifySiteURL"):localStorage.setItem("netlifySiteURL",u.default.siteURL),u.default.siteURL){var n=u.default.siteURL.replace(/\/$/,"");e="".concat(n,"/.netlify/identity")}u.default.init(O(e),!0)})),(0,o.observe)(u.default,"user",(function(){u.default.user?T("login",u.default.user):T("logout")})),(0,o.observe)(u.default,"gotrue",(function(){u.default.gotrue&&T("init",u.default.gotrue.currentUser())})),(0,o.observe)(u.default,"error",(function(){T("error",u.default.error)}));var L=/(confirmation|invite|recovery|email_change)_token=([^&]+)/,h=/error=access_denied&error_description=403/,v=/access_token=/;function m(){var e=(document.location.hash||"").replace(/^#\/?/,"");if(e){var n=e.match(L);if(n&&(u.default.verifyToken(n[1],n[2]),document.location.hash=""),e.match(h)&&(u.default.openModal("signup"),document.location.hash=""),e.match(v)){var t={};if(e.split("&").forEach((function(e){var n=N(e.split("="),2),r=n[0],o=n[1];t[r]=o})),document&&t.access_token&&(document.cookie="nf_jwt=".concat(t.access_token)),t.state)try{var r=decodeURIComponent(t.state);if("implicit"===JSON.parse(r).auth_type)return}catch(e){}document.location.hash="",u.default.openModal("login"),u.default.completeExternalLogin(t)}}}var b=A;n.default=b},function(e,n,t){"use strict";function r(e){return(r="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})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=a();if(n&&n.has(e))return n.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var M=o?Object.getOwnPropertyDescriptor(e,i):null;M&&(M.get||M.set)?Object.defineProperty(t,i,M):t[i]=e[i]}t.default=e,n&&n.set(e,t);return t}(t(4)),M=(o=t(12))&&o.__esModule?o:{default:o};function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function u(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function s(e,n){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=n.APIUrl,r=void 0===t?"/.netlify/identity":t,o=n.audience,M=void 0===o?"":o,a=n.setCookie,s=void 0!==a&&a;u(this,e),r.match(c)&&console.warn("Warning:\n\nDO NOT USE HTTP IN PRODUCTION FOR GOTRUE EVER!\nGoTrue REQUIRES HTTPS to work securely."),M&&(this.audience=M),this.setCookie=s,this.api=new i.default(r)}var n,t,r;return n=e,(t=[{key:"_request",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.headers=n.headers||{};var t=n.audience||this.audience;return t&&(n.headers["X-JWT-AUD"]=t),this.api.request(e,n).catch((function(e){return e instanceof i.JSONHTTPError&&e.json&&(e.json.msg?e.message=e.json.msg:e.json.error&&(e.message="".concat(e.json.error,": ").concat(e.json.error_description))),Promise.reject(e)}))}},{key:"settings",value:function(){return this._request("/settings")}},{key:"signup",value:function(e,n,t){return this._request("/signup",{method:"POST",body:JSON.stringify({email:e,password:n,data:t})})}},{key:"login",value:function(e,n,t){var r=this;return this._setRememberHeaders(t),this._request("/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"grant_type=password&username=".concat(encodeURIComponent(e),"&password=").concat(encodeURIComponent(n))}).then((function(e){return M.default.removeSavedSession(),r.createUser(e,t)}))}},{key:"loginExternalUrl",value:function(e){return"".concat(this.api.apiURL,"/authorize?provider=").concat(e)}},{key:"confirm",value:function(e,n){return this._setRememberHeaders(n),this.verify("signup",e,n)}},{key:"requestPasswordRecovery",value:function(e){return this._request("/recover",{method:"POST",body:JSON.stringify({email:e})})}},{key:"recover",value:function(e,n){return this._setRememberHeaders(n),this.verify("recovery",e,n)}},{key:"acceptInvite",value:function(e,n,t){var r=this;return this._setRememberHeaders(t),this._request("/verify",{method:"POST",body:JSON.stringify({token:e,password:n,type:"signup"})}).then((function(e){return r.createUser(e,t)}))}},{key:"acceptInviteExternalUrl",value:function(e,n){return"".concat(this.api.apiURL,"/authorize?provider=").concat(e,"&invite_token=").concat(n)}},{key:"createUser",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._setRememberHeaders(n);var t=new M.default(this.api,e,this.audience);return t.getUserData().then((function(e){return n&&e._saveSession(),e}))}},{key:"currentUser",value:function(){var e=M.default.recoverSession(this.api);return e&&this._setRememberHeaders(e._fromStorage),e}},{key:"verify",value:function(e,n,t){var r=this;return this._setRememberHeaders(t),this._request("/verify",{method:"POST",body:JSON.stringify({token:n,type:e})}).then((function(e){return r.createUser(e,t)}))}},{key:"_setRememberHeaders",value:function(e){this.setCookie&&(this.api.defaultHeaders=this.api.defaultHeaders||{},this.api.defaultHeaders["X-Use-Cookie"]=e?"1":"session")}}])&&s(n.prototype,t),r&&s(n,r),e}();n.default=l,"undefined"!=typeof window&&(window.GoTrue=l)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,n){var t=[],r=!0,o=!1,i=void 0;try{for(var M,a=e[Symbol.iterator]();!(r=(M=a.next()).done)&&(t.push(M.value),!n||t.length!==n);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return t}(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n.getPagination=function(e){var n=e.headers.get("Link"),t={};if(null==n)return null;n=n.split(",");for(var o=e.headers.get("X-Total-Count"),i=0,M=n.length;i1&&void 0!==arguments[1]?arguments[1]:{};t.headers=t.headers||{};var r=t.audience||this.audience;return r&&(t.headers["X-JWT-AUD"]=r),this.jwt().then((function(r){return n.api.request(e,s({headers:Object.assign(t.headers,{Authorization:"Bearer ".concat(r)})},t)).catch((function(e){return e instanceof i.JSONHTTPError&&e.json&&(e.json.msg?e.message=e.json.msg:e.json.error&&(e.message="".concat(e.json.error,": ").concat(e.json.error_description))),Promise.reject(e)}))}))}},{key:"getUserData",value:function(){return this._request("/user").then(this._saveUserData.bind(this)).then(this._refreshSavedSession.bind(this))}},{key:"_saveUserData",value:function(n,t){for(var r in n)r in e.prototype||r in g||(this[r]=n[r]);return t&&(this._fromStorage=!0),this}},{key:"_processTokenResponse",value:function(e){this.token=e;try{var n=JSON.parse(function(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw"Illegal base64url string!"}var t=window.atob(n);try{return decodeURIComponent(escape(t))}catch(e){return t}}(e.access_token.split(".")[1]));this.token.expires_at=1e3*n.exp}catch(e){console.error(new Error("Gotrue-js: Failed to parse tokenResponse claims: ".concat(e)))}}},{key:"_refreshSavedSession",value:function(){return j()&&localStorage.getItem("gotrue.user")&&this._saveSession(),this}},{key:"_saveSession",value:function(){return j()&&localStorage.setItem("gotrue.user",JSON.stringify(this._details)),this}},{key:"tokenDetails",value:function(){return this.token}},{key:"clearSession",value:function(){e.removeSavedSession(),this.token=null,D=null}},{key:"admin",get:function(){return new M.default(this)}},{key:"_details",get:function(){var n={};for(var t in this)t in e.prototype||t in y||(n[t]=this[t]);return n}}])&&l(n.prototype,t),r&&l(n,r),e}();n.default=z},function(e,n,t){"use strict";function r(e,n){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return this.user._request("/admin/users/".concat(e.id),{method:"PUT",body:JSON.stringify(n)})}},{key:"createUser",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.email=e,t.password=n,this.user._request("/admin/users",{method:"POST",body:JSON.stringify(t)})}},{key:"deleteUser",value:function(e){return this.user._request("/admin/users/".concat(e.id),{method:"DELETE"})}}])&&r(n.prototype,t),o&&r(n,o),e}();n.default=o},function(e,n,t){"use strict";function r(e){return(r="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})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=t(0),M=t(2),a=D(t(15)),u=D(t(16)),s=D(t(17)),c=D(t(18)),l=D(t(19)),N=D(t(6));function D(e){return e&&e.__esModule?e:{default:e}}function g(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function y(e,n){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"en",t=g[n]&&g[n][e];return t||g.en[e]||e}},function(e){e.exports=JSON.parse('{"log_in":"Log in","log_out":"Log out","logged_in_as":"Logged in as","logged_in":"Logged in","logging_in":"Logging in","logging_out":"Logging out","sign_up":"Sign up","signing_up":"Signing up","forgot_password":"Forgot password?","recover_password":"Recover password","send_recovery_email":"Send recovery email","sending_recovery_email":"Sending recovery email","never_mind":"Never mind","update_password":"Update password","updating_password":"Updating password","complete_your_signup":"Complete your signup","site_url_title":"Development Settings","site_url_link_text":"Clear localhost URL","site_url_message":"Looks like you\'re running a local server. Please let us know the URL of your Netlify site.","site_url_label":"Enter your Netlify Site URL","site_url_placeholder":"URL of your Netlify site","site_url_submit":"Set site\'s URL","message_confirm":"A confirmation message was sent to your email, click the link there to continue.","message_password_mail":"We\'ve sent a recovery email to your account, follow the link there to reset your password.","message_email_changed":"Your email address has been updated!","message_verfication_error":"There was an error verifying your account. Please try again or contact an administrator.","message_signup_disabled":"Public signups are disabled. Contact an administrator and ask for an invite.","form_name_placeholder":"Name","form_email_label":"Enter your email","form_name_label":"Enter your name","form_email_placeholder":"Email","form_password_label":"Enter your password","form_password_placeholder":"Password","coded_by":"Coded by Netlify","continue_with":"Continue with","No user found with this email":"No user found with this email","Invalid Password":"Invalid Password","Email not confirmed":"Email not confirmed","User not found":"User not found"}')},function(e){e.exports=JSON.parse('{"log_in":"Connexion","log_out":"Déconnexion","logged_in_as":"Connecté en tant que","logged_in":"Connecté","logging_in":"Connexion","logging_out":"Déconnexion","sign_up":"Inscription","signing_up":"Inscription","forgot_password":"Mot de passe oublié ?","recover_password":"Récupérer le mot de passe","send_recovery_email":"Envoyer l\'e-mail de récupération","sending_recovery_email":"Envoi de l\'e-mail de récupération","never_mind":"Annuler","update_password":"Mettre à jour le mot de passe","updating_password":"Mise à jour du mot de passe","complete_your_signup":"Compléter l\'inscription","site_url_title":"Paramètres de développement","site_url_link_text":"Effacer l\'URL localhost","site_url_message":"On dirait que vous faites tourner un serveur local. Veuillez nous indiquer l\'URL de votre site Netlify.","site_url_label":"Entrez l\'URL de votre site Netlify","site_url_placeholder":"URL de votre site Netlify","site_url_submit":"Définir l\'URL du site","message_confirm":"Un message de confirmation a été envoyé à votre adresse électronique, cliquez sur le lien pour continuer.","message_password_mail":"Nous avons envoyé un e-mail de récupération à votre compte, suivez le lien qui s\'y trouve pour réinitialiser votre mot de passe.","message_email_changed":"Votre adresse e-mail a été mise à jour !","message_verfication_error":"Il y a eu une erreur lors de la vérification de votre compte. Veuillez réessayer ou contacter un administrateur.","message_signup_disabled":"Les inscriptions publiques sont désactivées. Contactez un administrateur et demandez une invitation.","form_name_placeholder":"Nom","form_email_label":"Entrez votre adresse e-mail","form_name_label":"Saisissez votre nom","form_email_placeholder":"E-mail","form_password_label":"Saisissez votre mot de passe","form_password_placeholder":"Mot de passe","coded_by":"Codé par Netlify","continue_with":"Continuer avec","No user found with this email":"Aucun utilisateur trouvé avec cet e-mail","Invalid Password":"Mot de passe incorrect","Email not confirmed":"Adresse e-mail non confirmée","User not found":"Aucun utilisateur trouvé"}')},function(e){e.exports=JSON.parse('{"log_in":"Iniciar sesión","log_out":"Cerrar sesión","logged_in_as":"Conectado como","logged_in":"Conectado","logging_in":"Iniciando sesión","logging_out":"Cerrando sesión","sign_up":"Registrate","signing_up":"Registrandose","forgot_password":"¿Olvidaste tu contraseña?","recover_password":"Recuperar contraseña","send_recovery_email":"Enviar correo electrónico de recuperación","sending_recovery_email":"Enviando correo electrónico de recuperación","never_mind":"Regresar","update_password":"Actualizar contraseña","updating_password":"Actualizando contraseña","complete_your_signup":"Completa tu registro","site_url_title":"Configuración de desarrollo","site_url_link_text":"Borrar URL del localhost","site_url_message":"Parece que estas corriendo un servidor local. Por favor haznos saber la URL de tu sitio en Netlify.","site_url_label":"Ingresa la URL de tu sitio en Netlify","site_url_placeholder":"URL de tu sitio en Netlify","site_url_submit":"Establecer la URL del sitio","message_confirm":"Se envió un mensaje de confirmación a tu correo electrónico, haz clic en el enlace allí para continuar.","message_password_mail":"Hemos enviado un correo electrónico de recuperación a tu correo electrónico, sigue el enlace allí para restablecer tu contraseña.","message_email_changed":"¡Tu dirección de correo electrónico ha sido actualizada!","message_verfication_error":"Se produjo un error al verificar tu cuenta. Por favor intenta nuevamente o contacta a un administrador.","message_signup_disabled":"Los registros públicos están deshabilitados. Contacta a un administrador y solicita una invitación.","form_name_placeholder":"Nombre","form_email_label":"Ingresa tu correo electrónico","form_name_label":"Ingresa tu nombre","form_email_placeholder":"Correo electrónico","form_password_label":"Ingresa tu contraseña","form_password_placeholder":"Contraseña","coded_by":"Codificado por Netlify","continue_with":"Continúa con","No user found with this email":"No existe ningún usuario con este correo electrónico","Invalid Password":"La contraseña es invalida","Email not confirmed":"Correo electrónico no confirmado","User not found":"Usuario no encontrado"}')},function(e){e.exports=JSON.parse('{"log_in":"Bejelentkezés","log_out":"Kijelentkezés","logged_in_as":"Bejelentkezve mint","logged_in":"Bejelentkezve","logging_in":"Bejelentkezés","logging_out":"Kijelentkezés","sign_up":"Regisztráció","signing_up":"Regisztrálás","forgot_password":"Elfelejtette a jelszavát?","recover_password":"Jelszó visszaállítása","send_recovery_email":"Jelszópótló levél küldése","sending_recovery_email":"Jelszópótló levél küldése","never_mind":"Mégsem","update_password":"Új jelszó beállítása","updating_password":"Új jelszó beállítása","complete_your_signup":"Regisztráció befejezése","site_url_title":"Fejlesztői Beállítások","site_url_link_text":"Localhost URL törlése","site_url_message":"Úgy néz ki egy helyi szervert futtat. Kérjük adja meg a Netlify oldala URL-jét.","site_url_label":"Adja meg a Netlify oldala URL-jét","site_url_placeholder":"a Netlify oldala URL-je","site_url_submit":"URL beállítása","message_confirm":"Elküldtünk egy megerősítő levelet e-mailben, kérjük kattintson a linkre a levélben a folytatáshoz.","message_password_mail":"Elküldtünk egy jelszópótló levelet e-mailben, kérjük kövesse a linket a levélben a jelszava visszaállításához.","message_email_changed":"Az e-mail címét frissítettük!","message_verfication_error":"Probléma történt a fiókja megerősítése közben. Kérjük próbálja újra, vagy vegye fel a kapcsolatot egy adminisztrátorral.","message_signup_disabled":"A nyilvános regisztráció nincs engedélyezve. Vegye fel a kapcsolatot egy adminisztrátorral és kérjen meghívót.","form_name_placeholder":"Név","form_email_label":"Adja meg az e-mail címét","form_name_label":"Adja meg a nevét","form_email_placeholder":"E-mail","form_password_label":"Adja meg a jelszavát","form_password_placeholder":"Jelszó","coded_by":"Fejlesztette a Netlify","continue_with":"Bejelentkezés ezzel:","No user found with this email":"Nem található fiók ezzel az e-mail címmel","Invalid Password":"Helytelen Jelszó","Email not confirmed":"Az e-mail nem erősült meg","User not found":"Felhasználó nem található"}')},function(e){e.exports=JSON.parse('{"log_in":"Entrar","log_out":"Sair","logged_in_as":"Logado como","logged_in":"Logado em","logging_in":"Logando em","logging_out":"Saindo","sign_up":"Registrar","signing_up":"Registrando","forgot_password":"Esqueceu a senha?","recover_password":"Recuperar senha","send_recovery_email":"Enviar email de recuperação de senha","sending_recovery_email":"Enviando email de recuperação de senha","never_mind":"Deixa pra lá","update_password":"Atualizar senha","updating_password":"Atualizando senha","complete_your_signup":"Complete seu registro","site_url_title":"Configurações de desenvolvimento","site_url_link_text":"Limpar URL do localhost","site_url_message":"Parece que você está executando um servidor local. Informe-nos o URL do seu site Netlify.","site_url_label":"Insira o URL do seu site Netlify","site_url_placeholder":"URL do seu site Netlify","site_url_submit":"Configure a URL do seu site","message_confirm":"Uma mensagem de confirmação foi enviada para o seu email, clique no link para continuar.","message_password_mail":"Enviamos um e-mail de recuperação para sua conta, siga o link para redefinir sua senha.","message_email_changed":"Seu email foi atualizado!","message_verfication_error":"Ocorreu um erro ao verificar sua conta. Tente novamente ou entre em contato com um administrador.","message_signup_disabled":"Registros públicos estão desabilitados. Contate um administrador e peça por um convite.","form_name_placeholder":"Nome","form_email_label":"Insira seu email","form_name_label":"Insira seu nome","form_email_placeholder":"Email","form_password_label":"Insira sua senha","form_password_placeholder":"Senha","coded_by":"Desenvolvido por Netlify","continue_with":"Continue com","No user found with this email":"Nenhum usuário encontrado com esse email","Invalid Password":"Senha inválida","Email not confirmed":"Email não confirmado","User not found":"Usuário não encontrado"}')},function(e){e.exports=JSON.parse('{"log_in":"Zaloguj się","log_out":"Wyloguj się","logged_in_as":"Zaloguj jako","logged_in":"Zalogowany","logging_in":"Logowanie","logging_out":"Wylogowywanie","sign_up":"Zarejestruj się","signing_up":"Rejestracja","forgot_password":"Nie pamiętasz hasła?","recover_password":"Resetuj hasło","send_recovery_email":"Wyślij link do resetowania hasła","sending_recovery_email":"Wysyłanie linku do resetowania hasła","never_mind":"Nieistotne","update_password":"Zaktualizuj hasło","updating_password":"Aktualizowanie hasło","complete_your_signup":"Dokończ rejestrację","site_url_title":"Ustawienia strony","site_url_link_text":"Usuń adres localhost","site_url_message":"Wygląda na to że został uruchomiony lokalny serwer. Wprowadź adres Twojej strony na Netlify.","site_url_label":"Wprowadz adres strony na Netlify","site_url_placeholder":"Adres Twojej strony na Netlify","site_url_submit":"Ustaw adres strony","message_confirm":"Potwierdzenie zostało wysłane na Twój adres email. Kliknij w link w wiadomości aby kontunuować.","message_password_mail":"Wysłaliśmy link resetujący hasło na Twój adres email. Klknij w link w wiadomości aby zresetować hasło.","message_email_changed":"Twój adres email został zaktualizowany!","message_verfication_error":"Wystąpił błąd podczas weryfikcacji Twoje konta. Spróbuj ponownie lub skontaktuj się z administratorem,","message_signup_disabled":"Publiczna rejestracja jest wyłączona. Skontaktuj się z administratorem by uzyskać zaproszenie.","form_name_placeholder":"Imię","form_email_label":"Wprowadź Twój adres email","form_name_label":"Wprowadź Twoje imię","form_email_placeholder":"Email","form_password_label":"Wprowadź twoje hasło","form_password_placeholder":"Hasło","coded_by":"Coded by Netlify","continue_with":"Kontynuuj z","No user found with this email":"Nie znaleziono użytkownika o tym adresie","Invalid Password":"Hasło nieprawidłowe","Email not confirmed":"Email nie został potwierdzony","User not found":"Nie znaleziono użytkownika"}')},function(e){e.exports=JSON.parse('{"log_in":"Přihlásit se","log_out":"Odhlásit se","logged_in_as":"Přihlášen jako","logged_in":"Přihlášený uživatel","logging_in":"Probíhá přihlášení","logging_out":"Probíhá odhlášení","sign_up":"Zaregistrovat se","signing_up":"Registrace","forgot_password":"Zapomněli jste heslo?","recover_password":"Obnovit heslo","send_recovery_email":"Odeslat e-mail pro obnovení","sending_recovery_email":"Odesílání e-mailu pro obnovení","never_mind":"Zpět","update_password":"Aktualizovat heslo","updated_password":"Aktualizace hesla","complete_your_signup":"Dokončete registraci","site_url_title":"Nastavení vývoje","site_url_link_text":"Vymazat URL localhost","site_url_message":"Zdá se, že používáte lokální server. Sdělte nám prosím adresu URL svého Netlify serveru.","site_url_label":"Zadejte adresu URL svého serveru Netlify","site_url_placeholder":"URL vašeho Netlify serveru","site_url_submit":"Nastavit adresu URL","message_confirm":"Na váš e-mail byl odeslán odkaz k potvrzení registrace, pokračujte kliknutím na tento odkaz.","message_password_mail":"Zaslali jsme vám e-mail pro obnovení hesla, heslo obnovíte kliknutím na odkaz v e-mailu.","message_email_changed":"Vaše e-mailová adresa byla aktualizována!","message_verfication_error":"Při ověřování vašeho účtu došlo k chybě. Zkuste to prosím znovu nebo kontaktujte správce.","message_signup_disabled":"Registrace pro veřejnost jsou zakázány. Kontaktujte správce a požádejte o pozvánku.","form_name_placeholder":"Jméno","form_email_label":"Zadejte svůj e-mail","form_name_label":"Zadejte své jméno","form_email_placeholder":"E-mail","form_password_label":"Zadejte své heslo","form_password_placeholder":"Heslo","coded_by":"Vytvořeno Netlify","continue_with":"Pokračovat přes","No user found with this email":"Nebyl nalezen žádný uživatel s tímto e-mailem","Invalid Password":"Neplatné heslo","Email not confirmed":"E-mail nebyl potvrzen","User not found":"Uživatel nebyl nalezen"}')},function(e){e.exports=JSON.parse('{"log_in":"Prihlásiť sa","log_out":"Odhlásiť sa","logged_in_as":"Prihlásený ako","logged_in":"Prihlásený užívateľ","logging_in":"Prebieha prihlásenie","logging_out":"Prebieha odhlásenie","sign_up":"Zaregistrovať sa","signing_up":"Registrácia","forgot_password":"Zabudli ste heslo?","recover_password":"Obnoviť heslo","send_recovery_email":"Odoslať e-mail pre obnovenie","sending_recovery_email":"Odosielanie e-mailu pre obnovenie","never_mind":"Naspäť","update_password":"Aktualizovať heslo","updated_password":"Aktualizácia hesla","complete_your_signup":"Dokončite registráciu","site_url_title":"Nastavenie vývoja","site_url_link_text":"Vymazať URL localhost","site_url_message":"Zdá sa, že používate lokálny server. Prosím, nastavte URL adresu svojho Netlify servera.","site_url_label":"Zadajte URL svojho Netlify servera","site_url_placeholder":"URL vášho Netlify servera","site_url_submit":"Nastaviť URL adresu","message_confirm":"Potvrďte registráciu kliknutím na odkaz v správe, ktorú sme Vám práve zaslali na váš email.","message_password_mail":"Poslali sme vám e-mail pre obnovenie hesla, heslo obnovíte kliknutím na odkaz v e-maile.","message_email_changed":"Vaša e-mailová adresa bola aktualizovaná!","message_verfication_error":"Pri overovaní vášho účtu došlo k chybe. Prosím, skúste to znova alebo kontaktujte správcu.","message_signup_disabled":"Registrácia pre verejnosť sú zakázané. Kontaktujte správcu a požiadajte o pozvánku.","form_name_placeholder":"Meno","form_email_label":"Zadajte svoj e-mail","form_name_label":"Zadajte svoje meno","form_email_placeholder":"E-mail","form_password_label":"Zadajte svoje heslo","form_password_placeholder":"Heslo","coded_by":"Vytvorené Netlify","continue_with":"Pokračovať cez","No user found with this email":"Nebol nájdený žiadny užívateľ s týmto e-mailom","Invalid Password":"Neplatné heslo","Email not confirmed":"E-mail nebol potvrdený","User not found":"Používateľ nebol nájdený"}')},function(e,n,t){"use strict";function r(e){return(r="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})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=t(0);function M(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function a(e,n){for(var t=0;t 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/** MobX - (c) Michel Weststrate 2015 - 2020 - MIT Licensed */\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\n\nvar OBFUSCATED_ERROR = \"An invariant failed, however the error is obfuscated because this is a production build.\";\r\nvar EMPTY_ARRAY = [];\r\nObject.freeze(EMPTY_ARRAY);\r\nvar EMPTY_OBJECT = {};\r\nObject.freeze(EMPTY_OBJECT);\r\nfunction getNextId() {\r\n return ++globalState.mobxGuid;\r\n}\r\nfunction fail(message) {\r\n invariant(false, message);\r\n throw \"X\"; // unreachable\r\n}\r\nfunction invariant(check, message) {\r\n if (!check)\r\n throw new Error(\"[mobx] \" + (message || OBFUSCATED_ERROR));\r\n}\r\n/**\r\n * Prints a deprecation message, but only one time.\r\n * Returns false if the deprecated message was already printed before\r\n */\r\nvar deprecatedMessages = [];\r\nfunction deprecated(msg, thing) {\r\n if (process.env.NODE_ENV === \"production\")\r\n return false;\r\n if (thing) {\r\n return deprecated(\"'\" + msg + \"', use '\" + thing + \"' instead.\");\r\n }\r\n if (deprecatedMessages.indexOf(msg) !== -1)\r\n return false;\r\n deprecatedMessages.push(msg);\r\n console.error(\"[mobx] Deprecated: \" + msg);\r\n return true;\r\n}\r\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\r\nfunction once(func) {\r\n var invoked = false;\r\n return function () {\r\n if (invoked)\r\n return;\r\n invoked = true;\r\n return func.apply(this, arguments);\r\n };\r\n}\r\nvar noop = function () { };\r\nfunction unique(list) {\r\n var res = [];\r\n list.forEach(function (item) {\r\n if (res.indexOf(item) === -1)\r\n res.push(item);\r\n });\r\n return res;\r\n}\r\nfunction isObject(value) {\r\n return value !== null && typeof value === \"object\";\r\n}\r\nfunction isPlainObject(value) {\r\n if (value === null || typeof value !== \"object\")\r\n return false;\r\n var proto = Object.getPrototypeOf(value);\r\n return proto === Object.prototype || proto === null;\r\n}\r\nfunction addHiddenProp(object, propName, value) {\r\n Object.defineProperty(object, propName, {\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n value: value\r\n });\r\n}\r\nfunction addHiddenFinalProp(object, propName, value) {\r\n Object.defineProperty(object, propName, {\r\n enumerable: false,\r\n writable: false,\r\n configurable: true,\r\n value: value\r\n });\r\n}\r\nfunction isPropertyConfigurable(object, prop) {\r\n var descriptor = Object.getOwnPropertyDescriptor(object, prop);\r\n return !descriptor || (descriptor.configurable !== false && descriptor.writable !== false);\r\n}\r\nfunction assertPropertyConfigurable(object, prop) {\r\n if (process.env.NODE_ENV !== \"production\" && !isPropertyConfigurable(object, prop))\r\n fail(\"Cannot make property '\" + prop.toString() + \"' observable, it is not configurable and writable in the target object\");\r\n}\r\nfunction createInstanceofPredicate(name, clazz) {\r\n var propName = \"isMobX\" + name;\r\n clazz.prototype[propName] = true;\r\n return function (x) {\r\n return isObject(x) && x[propName] === true;\r\n };\r\n}\r\n/**\r\n * Returns whether the argument is an array, disregarding observability.\r\n */\r\nfunction isArrayLike(x) {\r\n return Array.isArray(x) || isObservableArray(x);\r\n}\r\nfunction isES6Map(thing) {\r\n return thing instanceof Map;\r\n}\r\nfunction isES6Set(thing) {\r\n return thing instanceof Set;\r\n}\r\n/**\r\n * Returns the following: own keys, prototype keys & own symbol keys, if they are enumerable.\r\n */\r\nfunction getPlainObjectKeys(object) {\r\n var enumerables = new Set();\r\n for (var key in object)\r\n enumerables.add(key); // *all* enumerables\r\n Object.getOwnPropertySymbols(object).forEach(function (k) {\r\n if (Object.getOwnPropertyDescriptor(object, k).enumerable)\r\n enumerables.add(k);\r\n }); // *own* symbols\r\n // Note: this implementation is missing enumerable, inherited, symbolic property names! That would however pretty expensive to add,\r\n // as there is no efficient iterator that returns *all* properties\r\n return Array.from(enumerables);\r\n}\r\nfunction stringifyKey(key) {\r\n if (key && key.toString)\r\n return key.toString();\r\n else\r\n return new String(key).toString();\r\n}\r\nfunction getMapLikeKeys(map) {\r\n if (isPlainObject(map))\r\n return Object.keys(map);\r\n if (Array.isArray(map))\r\n return map.map(function (_a) {\r\n var _b = __read(_a, 1), key = _b[0];\r\n return key;\r\n });\r\n if (isES6Map(map) || isObservableMap(map))\r\n return Array.from(map.keys());\r\n return fail(\"Cannot get keys from '\" + map + \"'\");\r\n}\r\nfunction toPrimitive(value) {\r\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\r\n}\n\nvar $mobx = Symbol(\"mobx administration\");\r\nvar Atom = /** @class */ (function () {\r\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\r\n function Atom(name) {\r\n if (name === void 0) { name = \"Atom@\" + getNextId(); }\r\n this.name = name;\r\n this.isPendingUnobservation = false; // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\r\n this.isBeingObserved = false;\r\n this.observers = new Set();\r\n this.diffValue = 0;\r\n this.lastAccessedBy = 0;\r\n this.lowestObserverState = IDerivationState.NOT_TRACKING;\r\n }\r\n Atom.prototype.onBecomeObserved = function () {\r\n if (this.onBecomeObservedListeners) {\r\n this.onBecomeObservedListeners.forEach(function (listener) { return listener(); });\r\n }\r\n };\r\n Atom.prototype.onBecomeUnobserved = function () {\r\n if (this.onBecomeUnobservedListeners) {\r\n this.onBecomeUnobservedListeners.forEach(function (listener) { return listener(); });\r\n }\r\n };\r\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\r\n Atom.prototype.reportObserved = function () {\r\n return reportObserved(this);\r\n };\r\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\r\n Atom.prototype.reportChanged = function () {\r\n startBatch();\r\n propagateChanged(this);\r\n endBatch();\r\n };\r\n Atom.prototype.toString = function () {\r\n return this.name;\r\n };\r\n return Atom;\r\n}());\r\nvar isAtom = createInstanceofPredicate(\"Atom\", Atom);\r\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\r\n if (onBecomeObservedHandler === void 0) { onBecomeObservedHandler = noop; }\r\n if (onBecomeUnobservedHandler === void 0) { onBecomeUnobservedHandler = noop; }\r\n var atom = new Atom(name);\r\n // default `noop` listener will not initialize the hook Set\r\n if (onBecomeObservedHandler !== noop) {\r\n onBecomeObserved(atom, onBecomeObservedHandler);\r\n }\r\n if (onBecomeUnobservedHandler !== noop) {\r\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\r\n }\r\n return atom;\r\n}\n\nfunction identityComparer(a, b) {\r\n return a === b;\r\n}\r\nfunction structuralComparer(a, b) {\r\n return deepEqual(a, b);\r\n}\r\nfunction shallowComparer(a, b) {\r\n return deepEqual(a, b, 1);\r\n}\r\nfunction defaultComparer(a, b) {\r\n return Object.is(a, b);\r\n}\r\nvar comparer = {\r\n identity: identityComparer,\r\n structural: structuralComparer,\r\n default: defaultComparer,\r\n shallow: shallowComparer\r\n};\n\nvar mobxDidRunLazyInitializersSymbol = Symbol(\"mobx did run lazy initializers\");\r\nvar mobxPendingDecorators = Symbol(\"mobx pending decorators\");\r\nvar enumerableDescriptorCache = {};\r\nvar nonEnumerableDescriptorCache = {};\r\nfunction createPropertyInitializerDescriptor(prop, enumerable) {\r\n var cache = enumerable ? enumerableDescriptorCache : nonEnumerableDescriptorCache;\r\n return (cache[prop] ||\r\n (cache[prop] = {\r\n configurable: true,\r\n enumerable: enumerable,\r\n get: function () {\r\n initializeInstance(this);\r\n return this[prop];\r\n },\r\n set: function (value) {\r\n initializeInstance(this);\r\n this[prop] = value;\r\n }\r\n }));\r\n}\r\nfunction initializeInstance(target) {\r\n var e_1, _a;\r\n if (target[mobxDidRunLazyInitializersSymbol] === true)\r\n return;\r\n var decorators = target[mobxPendingDecorators];\r\n if (decorators) {\r\n addHiddenProp(target, mobxDidRunLazyInitializersSymbol, true);\r\n // Build property key array from both strings and symbols\r\n var keys = __spread(Object.getOwnPropertySymbols(decorators), Object.keys(decorators));\r\n try {\r\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\r\n var key = keys_1_1.value;\r\n var d = decorators[key];\r\n d.propertyCreator(target, d.prop, d.descriptor, d.decoratorTarget, d.decoratorArguments);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n}\r\nfunction createPropDecorator(propertyInitiallyEnumerable, propertyCreator) {\r\n return function decoratorFactory() {\r\n var decoratorArguments;\r\n var decorator = function decorate(target, prop, descriptor, applyImmediately\r\n // This is a special parameter to signal the direct application of a decorator, allow extendObservable to skip the entire type decoration part,\r\n // as the instance to apply the decorator to equals the target\r\n ) {\r\n if (applyImmediately === true) {\r\n propertyCreator(target, prop, descriptor, target, decoratorArguments);\r\n return null;\r\n }\r\n if (process.env.NODE_ENV !== \"production\" && !quacksLikeADecorator(arguments))\r\n fail(\"This function is a decorator, but it wasn't invoked like a decorator\");\r\n if (!Object.prototype.hasOwnProperty.call(target, mobxPendingDecorators)) {\r\n var inheritedDecorators = target[mobxPendingDecorators];\r\n addHiddenProp(target, mobxPendingDecorators, __assign({}, inheritedDecorators));\r\n }\r\n target[mobxPendingDecorators][prop] = {\r\n prop: prop,\r\n propertyCreator: propertyCreator,\r\n descriptor: descriptor,\r\n decoratorTarget: target,\r\n decoratorArguments: decoratorArguments\r\n };\r\n return createPropertyInitializerDescriptor(prop, propertyInitiallyEnumerable);\r\n };\r\n if (quacksLikeADecorator(arguments)) {\r\n // @decorator\r\n decoratorArguments = EMPTY_ARRAY;\r\n return decorator.apply(null, arguments);\r\n }\r\n else {\r\n // @decorator(args)\r\n decoratorArguments = Array.prototype.slice.call(arguments);\r\n return decorator;\r\n }\r\n };\r\n}\r\nfunction quacksLikeADecorator(args) {\r\n return (((args.length === 2 || args.length === 3) &&\r\n (typeof args[1] === \"string\" || typeof args[1] === \"symbol\")) ||\r\n (args.length === 4 && args[3] === true));\r\n}\n\nfunction deepEnhancer(v, _, name) {\r\n // it is an observable already, done\r\n if (isObservable(v))\r\n return v;\r\n // something that can be converted and mutated?\r\n if (Array.isArray(v))\r\n return observable.array(v, { name: name });\r\n if (isPlainObject(v))\r\n return observable.object(v, undefined, { name: name });\r\n if (isES6Map(v))\r\n return observable.map(v, { name: name });\r\n if (isES6Set(v))\r\n return observable.set(v, { name: name });\r\n return v;\r\n}\r\nfunction shallowEnhancer(v, _, name) {\r\n if (v === undefined || v === null)\r\n return v;\r\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v))\r\n return v;\r\n if (Array.isArray(v))\r\n return observable.array(v, { name: name, deep: false });\r\n if (isPlainObject(v))\r\n return observable.object(v, undefined, { name: name, deep: false });\r\n if (isES6Map(v))\r\n return observable.map(v, { name: name, deep: false });\r\n if (isES6Set(v))\r\n return observable.set(v, { name: name, deep: false });\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\r\n}\r\nfunction referenceEnhancer(newValue) {\r\n // never turn into an observable\r\n return newValue;\r\n}\r\nfunction refStructEnhancer(v, oldValue, name) {\r\n if (process.env.NODE_ENV !== \"production\" && isObservable(v))\r\n throw \"observable.struct should not be used with observable values\";\r\n if (deepEqual(v, oldValue))\r\n return oldValue;\r\n return v;\r\n}\n\nfunction createDecoratorForEnhancer(enhancer) {\r\n invariant(enhancer);\r\n var decorator = createPropDecorator(true, function (target, propertyName, descriptor, _decoratorTarget, decoratorArgs) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(!descriptor || !descriptor.get, \"@observable cannot be used on getter (property \\\"\" + stringifyKey(propertyName) + \"\\\"), use @computed instead.\");\r\n }\r\n var initialValue = descriptor\r\n ? descriptor.initializer\r\n ? descriptor.initializer.call(target)\r\n : descriptor.value\r\n : undefined;\r\n asObservableObject(target).addObservableProp(propertyName, initialValue, enhancer);\r\n });\r\n var res = \r\n // Extra process checks, as this happens during module initialization\r\n typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\"\r\n ? function observableDecorator() {\r\n // This wrapper function is just to detect illegal decorator invocations, deprecate in a next version\r\n // and simply return the created prop decorator\r\n if (arguments.length < 2)\r\n return fail(\"Incorrect decorator invocation. @observable decorator doesn't expect any arguments\");\r\n return decorator.apply(null, arguments);\r\n }\r\n : decorator;\r\n res.enhancer = enhancer;\r\n return res;\r\n}\n\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\r\n// in the majority of cases\r\nvar defaultCreateObservableOptions = {\r\n deep: true,\r\n name: undefined,\r\n defaultDecorator: undefined,\r\n proxy: true\r\n};\r\nObject.freeze(defaultCreateObservableOptions);\r\nfunction assertValidOption(key) {\r\n if (!/^(deep|name|equals|defaultDecorator|proxy)$/.test(key))\r\n fail(\"invalid option for (extend)observable: \" + key);\r\n}\r\nfunction asCreateObservableOptions(thing) {\r\n if (thing === null || thing === undefined)\r\n return defaultCreateObservableOptions;\r\n if (typeof thing === \"string\")\r\n return { name: thing, deep: true, proxy: true };\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof thing !== \"object\")\r\n return fail(\"expected options object\");\r\n Object.keys(thing).forEach(assertValidOption);\r\n }\r\n return thing;\r\n}\r\nvar deepDecorator = createDecoratorForEnhancer(deepEnhancer);\r\nvar shallowDecorator = createDecoratorForEnhancer(shallowEnhancer);\r\nvar refDecorator = createDecoratorForEnhancer(referenceEnhancer);\r\nvar refStructDecorator = createDecoratorForEnhancer(refStructEnhancer);\r\nfunction getEnhancerFromOptions(options) {\r\n return options.defaultDecorator\r\n ? options.defaultDecorator.enhancer\r\n : options.deep === false\r\n ? referenceEnhancer\r\n : deepEnhancer;\r\n}\r\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\r\nfunction createObservable(v, arg2, arg3) {\r\n // @observable someProp;\r\n if (typeof arguments[1] === \"string\" || typeof arguments[1] === \"symbol\") {\r\n return deepDecorator.apply(null, arguments);\r\n }\r\n // it is an observable already, done\r\n if (isObservable(v))\r\n return v;\r\n // something that can be converted and mutated?\r\n var res = isPlainObject(v)\r\n ? observable.object(v, arg2, arg3)\r\n : Array.isArray(v)\r\n ? observable.array(v, arg2)\r\n : isES6Map(v)\r\n ? observable.map(v, arg2)\r\n : isES6Set(v)\r\n ? observable.set(v, arg2)\r\n : v;\r\n // this value could be converted to a new observable data structure, return it\r\n if (res !== v)\r\n return res;\r\n // otherwise, just box it\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n \"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'\");\r\n}\r\nvar observableFactories = {\r\n box: function (value, options) {\r\n if (arguments.length > 2)\r\n incorrectlyUsedAsDecorator(\"box\");\r\n var o = asCreateObservableOptions(options);\r\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\r\n },\r\n array: function (initialValues, options) {\r\n if (arguments.length > 2)\r\n incorrectlyUsedAsDecorator(\"array\");\r\n var o = asCreateObservableOptions(options);\r\n return createObservableArray(initialValues, getEnhancerFromOptions(o), o.name);\r\n },\r\n map: function (initialValues, options) {\r\n if (arguments.length > 2)\r\n incorrectlyUsedAsDecorator(\"map\");\r\n var o = asCreateObservableOptions(options);\r\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\r\n },\r\n set: function (initialValues, options) {\r\n if (arguments.length > 2)\r\n incorrectlyUsedAsDecorator(\"set\");\r\n var o = asCreateObservableOptions(options);\r\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\r\n },\r\n object: function (props, decorators, options) {\r\n if (typeof arguments[1] === \"string\")\r\n incorrectlyUsedAsDecorator(\"object\");\r\n var o = asCreateObservableOptions(options);\r\n if (o.proxy === false) {\r\n return extendObservable({}, props, decorators, o);\r\n }\r\n else {\r\n var defaultDecorator = getDefaultDecoratorFromObjectOptions(o);\r\n var base = extendObservable({}, undefined, undefined, o);\r\n var proxy = createDynamicObservableObject(base);\r\n extendObservableObjectWithProperties(proxy, props, decorators, defaultDecorator);\r\n return proxy;\r\n }\r\n },\r\n ref: refDecorator,\r\n shallow: shallowDecorator,\r\n deep: deepDecorator,\r\n struct: refStructDecorator\r\n};\r\nvar observable = createObservable;\r\n// weird trick to keep our typings nicely with our funcs, and still extend the observable function\r\nObject.keys(observableFactories).forEach(function (name) { return (observable[name] = observableFactories[name]); });\r\nfunction incorrectlyUsedAsDecorator(methodName) {\r\n fail(\r\n // process.env.NODE_ENV !== \"production\" &&\r\n \"Expected one or two arguments to observable.\" + methodName + \". Did you accidentally try to use observable.\" + methodName + \" as decorator?\");\r\n}\n\nvar computedDecorator = createPropDecorator(false, function (instance, propertyName, descriptor, decoratorTarget, decoratorArgs) {\r\n var get = descriptor.get, set = descriptor.set; // initialValue is the descriptor for get / set props\r\n // Optimization: faster on decorator target or instance? Assuming target\r\n // Optimization: find out if declaring on instance isn't just faster. (also makes the property descriptor simpler). But, more memory usage..\r\n // Forcing instance now, fixes hot reloadig issues on React Native:\r\n var options = decoratorArgs[0] || {};\r\n asObservableObject(instance).addComputedProp(instance, propertyName, __assign({ get: get,\r\n set: set, context: instance }, options));\r\n});\r\nvar computedStructDecorator = computedDecorator({ equals: comparer.structural });\r\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\r\nvar computed = function computed(arg1, arg2, arg3) {\r\n if (typeof arg2 === \"string\") {\r\n // @computed\r\n return computedDecorator.apply(null, arguments);\r\n }\r\n if (arg1 !== null && typeof arg1 === \"object\" && arguments.length === 1) {\r\n // @computed({ options })\r\n return computedDecorator.apply(null, arguments);\r\n }\r\n // computed(expr, options?)\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(typeof arg1 === \"function\", \"First argument to `computed` should be an expression.\");\r\n invariant(arguments.length < 3, \"Computed takes one or two arguments if used as function\");\r\n }\r\n var opts = typeof arg2 === \"object\" ? arg2 : {};\r\n opts.get = arg1;\r\n opts.set = typeof arg2 === \"function\" ? arg2 : opts.set;\r\n opts.name = opts.name || arg1.name || \"\"; /* for generated name */\r\n return new ComputedValue(opts);\r\n};\r\ncomputed.struct = computedStructDecorator;\n\nvar IDerivationState;\r\n(function (IDerivationState) {\r\n // before being run or (outside batch and not being observed)\r\n // at this point derivation is not holding any data about dependency tree\r\n IDerivationState[IDerivationState[\"NOT_TRACKING\"] = -1] = \"NOT_TRACKING\";\r\n // no shallow dependency changed since last computation\r\n // won't recalculate derivation\r\n // this is what makes mobx fast\r\n IDerivationState[IDerivationState[\"UP_TO_DATE\"] = 0] = \"UP_TO_DATE\";\r\n // some deep dependency changed, but don't know if shallow dependency changed\r\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\r\n // currently only ComputedValue will propagate POSSIBLY_STALE\r\n //\r\n // having this state is second big optimization:\r\n // don't have to recompute on every dependency change, but only when it's needed\r\n IDerivationState[IDerivationState[\"POSSIBLY_STALE\"] = 1] = \"POSSIBLY_STALE\";\r\n // A shallow dependency has changed since last computation and the derivation\r\n // will need to recompute when it's needed next.\r\n IDerivationState[IDerivationState[\"STALE\"] = 2] = \"STALE\";\r\n})(IDerivationState || (IDerivationState = {}));\r\nvar TraceMode;\r\n(function (TraceMode) {\r\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\r\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\r\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\r\n})(TraceMode || (TraceMode = {}));\r\nvar CaughtException = /** @class */ (function () {\r\n function CaughtException(cause) {\r\n this.cause = cause;\r\n // Empty\r\n }\r\n return CaughtException;\r\n}());\r\nfunction isCaughtException(e) {\r\n return e instanceof CaughtException;\r\n}\r\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\r\nfunction shouldCompute(derivation) {\r\n switch (derivation.dependenciesState) {\r\n case IDerivationState.UP_TO_DATE:\r\n return false;\r\n case IDerivationState.NOT_TRACKING:\r\n case IDerivationState.STALE:\r\n return true;\r\n case IDerivationState.POSSIBLY_STALE: {\r\n // state propagation can occur outside of action/reactive context #2195\r\n var prevAllowStateReads = allowStateReadsStart(true);\r\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\r\n var obs = derivation.observing, l = obs.length;\r\n for (var i = 0; i < l; i++) {\r\n var obj = obs[i];\r\n if (isComputedValue(obj)) {\r\n if (globalState.disableErrorBoundaries) {\r\n obj.get();\r\n }\r\n else {\r\n try {\r\n obj.get();\r\n }\r\n catch (e) {\r\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\r\n untrackedEnd(prevUntracked);\r\n allowStateReadsEnd(prevAllowStateReads);\r\n return true;\r\n }\r\n }\r\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\r\n // and `derivation` is an observer of `obj`\r\n // invariantShouldCompute(derivation)\r\n if (derivation.dependenciesState === IDerivationState.STALE) {\r\n untrackedEnd(prevUntracked);\r\n allowStateReadsEnd(prevAllowStateReads);\r\n return true;\r\n }\r\n }\r\n }\r\n changeDependenciesStateTo0(derivation);\r\n untrackedEnd(prevUntracked);\r\n allowStateReadsEnd(prevAllowStateReads);\r\n return false;\r\n }\r\n }\r\n}\r\n// function invariantShouldCompute(derivation: IDerivation) {\r\n// const newDepState = (derivation as any).dependenciesState\r\n// if (\r\n// process.env.NODE_ENV === \"production\" &&\r\n// (newDepState === IDerivationState.POSSIBLY_STALE ||\r\n// newDepState === IDerivationState.NOT_TRACKING)\r\n// )\r\n// fail(\"Illegal dependency state\")\r\n// }\r\nfunction isComputingDerivation() {\r\n return globalState.trackingDerivation !== null; // filter out actions inside computations\r\n}\r\nfunction checkIfStateModificationsAreAllowed(atom) {\r\n var hasObservers = atom.observers.size > 0;\r\n // Should never be possible to change an observed observable from inside computed, see #798\r\n if (globalState.computationDepth > 0 && hasObservers)\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n \"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: \" + atom.name);\r\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\r\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"strict\"))\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n (globalState.enforceActions\r\n ? \"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: \"\r\n : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: \") +\r\n atom.name);\r\n}\r\nfunction checkIfStateReadsAreAllowed(observable) {\r\n if (process.env.NODE_ENV !== \"production\" &&\r\n !globalState.allowStateReads &&\r\n globalState.observableRequiresReaction) {\r\n console.warn(\"[mobx] Observable \" + observable.name + \" being read outside a reactive context\");\r\n }\r\n}\r\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\r\nfunction trackDerivedFunction(derivation, f, context) {\r\n var prevAllowStateReads = allowStateReadsStart(true);\r\n // pre allocate array allocation + room for variation in deps\r\n // array will be trimmed by bindDependencies\r\n changeDependenciesStateTo0(derivation);\r\n derivation.newObserving = new Array(derivation.observing.length + 100);\r\n derivation.unboundDepsCount = 0;\r\n derivation.runId = ++globalState.runId;\r\n var prevTracking = globalState.trackingDerivation;\r\n globalState.trackingDerivation = derivation;\r\n var result;\r\n if (globalState.disableErrorBoundaries === true) {\r\n result = f.call(context);\r\n }\r\n else {\r\n try {\r\n result = f.call(context);\r\n }\r\n catch (e) {\r\n result = new CaughtException(e);\r\n }\r\n }\r\n globalState.trackingDerivation = prevTracking;\r\n bindDependencies(derivation);\r\n warnAboutDerivationWithoutDependencies(derivation);\r\n allowStateReadsEnd(prevAllowStateReads);\r\n return result;\r\n}\r\nfunction warnAboutDerivationWithoutDependencies(derivation) {\r\n if (process.env.NODE_ENV === \"production\")\r\n return;\r\n if (derivation.observing.length !== 0)\r\n return;\r\n if (globalState.reactionRequiresObservable || derivation.requiresObservable) {\r\n console.warn(\"[mobx] Derivation \" + derivation.name + \" is created/updated without reading any observable value\");\r\n }\r\n}\r\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\r\nfunction bindDependencies(derivation) {\r\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\r\n var prevObserving = derivation.observing;\r\n var observing = (derivation.observing = derivation.newObserving);\r\n var lowestNewObservingDerivationState = IDerivationState.UP_TO_DATE;\r\n // Go through all new observables and check diffValue: (this list can contain duplicates):\r\n // 0: first occurrence, change to 1 and keep it\r\n // 1: extra occurrence, drop it\r\n var i0 = 0, l = derivation.unboundDepsCount;\r\n for (var i = 0; i < l; i++) {\r\n var dep = observing[i];\r\n if (dep.diffValue === 0) {\r\n dep.diffValue = 1;\r\n if (i0 !== i)\r\n observing[i0] = dep;\r\n i0++;\r\n }\r\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\r\n // not hitting the condition\r\n if (dep.dependenciesState > lowestNewObservingDerivationState) {\r\n lowestNewObservingDerivationState = dep.dependenciesState;\r\n }\r\n }\r\n observing.length = i0;\r\n derivation.newObserving = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\r\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\r\n // 0: it's not in new observables, unobserve it\r\n // 1: it keeps being observed, don't want to notify it. change to 0\r\n l = prevObserving.length;\r\n while (l--) {\r\n var dep = prevObserving[l];\r\n if (dep.diffValue === 0) {\r\n removeObserver(dep, derivation);\r\n }\r\n dep.diffValue = 0;\r\n }\r\n // Go through all new observables and check diffValue: (now it should be unique)\r\n // 0: it was set to 0 in last loop. don't need to do anything.\r\n // 1: it wasn't observed, let's observe it. set back to 0\r\n while (i0--) {\r\n var dep = observing[i0];\r\n if (dep.diffValue === 1) {\r\n dep.diffValue = 0;\r\n addObserver(dep, derivation);\r\n }\r\n }\r\n // Some new observed derivations may become stale during this derivation computation\r\n // so they have had no chance to propagate staleness (#916)\r\n if (lowestNewObservingDerivationState !== IDerivationState.UP_TO_DATE) {\r\n derivation.dependenciesState = lowestNewObservingDerivationState;\r\n derivation.onBecomeStale();\r\n }\r\n}\r\nfunction clearObserving(derivation) {\r\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\r\n var obs = derivation.observing;\r\n derivation.observing = [];\r\n var i = obs.length;\r\n while (i--)\r\n removeObserver(obs[i], derivation);\r\n derivation.dependenciesState = IDerivationState.NOT_TRACKING;\r\n}\r\nfunction untracked(action) {\r\n var prev = untrackedStart();\r\n try {\r\n return action();\r\n }\r\n finally {\r\n untrackedEnd(prev);\r\n }\r\n}\r\nfunction untrackedStart() {\r\n var prev = globalState.trackingDerivation;\r\n globalState.trackingDerivation = null;\r\n return prev;\r\n}\r\nfunction untrackedEnd(prev) {\r\n globalState.trackingDerivation = prev;\r\n}\r\nfunction allowStateReadsStart(allowStateReads) {\r\n var prev = globalState.allowStateReads;\r\n globalState.allowStateReads = allowStateReads;\r\n return prev;\r\n}\r\nfunction allowStateReadsEnd(prev) {\r\n globalState.allowStateReads = prev;\r\n}\r\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\r\nfunction changeDependenciesStateTo0(derivation) {\r\n if (derivation.dependenciesState === IDerivationState.UP_TO_DATE)\r\n return;\r\n derivation.dependenciesState = IDerivationState.UP_TO_DATE;\r\n var obs = derivation.observing;\r\n var i = obs.length;\r\n while (i--)\r\n obs[i].lowestObserverState = IDerivationState.UP_TO_DATE;\r\n}\n\n// we don't use globalState for these in order to avoid possible issues with multiple\r\n// mobx versions\r\nvar currentActionId = 0;\r\nvar nextActionId = 1;\r\nvar functionNameDescriptor = Object.getOwnPropertyDescriptor(function () { }, \"name\");\r\nvar isFunctionNameConfigurable = functionNameDescriptor && functionNameDescriptor.configurable;\r\nfunction createAction(actionName, fn, ref) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(typeof fn === \"function\", \"`action` can only be invoked on functions\");\r\n if (typeof actionName !== \"string\" || !actionName)\r\n fail(\"actions should have valid names, got: '\" + actionName + \"'\");\r\n }\r\n var res = function () {\r\n return executeAction(actionName, fn, ref || this, arguments);\r\n };\r\n res.isMobxAction = true;\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (isFunctionNameConfigurable) {\r\n Object.defineProperty(res, \"name\", { value: actionName });\r\n }\r\n }\r\n return res;\r\n}\r\nfunction executeAction(actionName, fn, scope, args) {\r\n var runInfo = _startAction(actionName, scope, args);\r\n try {\r\n return fn.apply(scope, args);\r\n }\r\n catch (err) {\r\n runInfo.error = err;\r\n throw err;\r\n }\r\n finally {\r\n _endAction(runInfo);\r\n }\r\n}\r\nfunction _startAction(actionName, scope, args) {\r\n var notifySpy = isSpyEnabled() && !!actionName;\r\n var startTime = 0;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\r\n startTime = Date.now();\r\n var l = (args && args.length) || 0;\r\n var flattendArgs = new Array(l);\r\n if (l > 0)\r\n for (var i = 0; i < l; i++)\r\n flattendArgs[i] = args[i];\r\n spyReportStart({\r\n type: \"action\",\r\n name: actionName,\r\n object: scope,\r\n arguments: flattendArgs\r\n });\r\n }\r\n var prevDerivation = untrackedStart();\r\n startBatch();\r\n var prevAllowStateChanges = allowStateChangesStart(true);\r\n var prevAllowStateReads = allowStateReadsStart(true);\r\n var runInfo = {\r\n prevDerivation: prevDerivation,\r\n prevAllowStateChanges: prevAllowStateChanges,\r\n prevAllowStateReads: prevAllowStateReads,\r\n notifySpy: notifySpy,\r\n startTime: startTime,\r\n actionId: nextActionId++,\r\n parentActionId: currentActionId\r\n };\r\n currentActionId = runInfo.actionId;\r\n return runInfo;\r\n}\r\nfunction _endAction(runInfo) {\r\n if (currentActionId !== runInfo.actionId) {\r\n fail(\"invalid action stack. did you forget to finish an action?\");\r\n }\r\n currentActionId = runInfo.parentActionId;\r\n if (runInfo.error !== undefined) {\r\n globalState.suppressReactionErrors = true;\r\n }\r\n allowStateChangesEnd(runInfo.prevAllowStateChanges);\r\n allowStateReadsEnd(runInfo.prevAllowStateReads);\r\n endBatch();\r\n untrackedEnd(runInfo.prevDerivation);\r\n if (runInfo.notifySpy && process.env.NODE_ENV !== \"production\") {\r\n spyReportEnd({ time: Date.now() - runInfo.startTime });\r\n }\r\n globalState.suppressReactionErrors = false;\r\n}\r\nfunction allowStateChanges(allowStateChanges, func) {\r\n var prev = allowStateChangesStart(allowStateChanges);\r\n var res;\r\n try {\r\n res = func();\r\n }\r\n finally {\r\n allowStateChangesEnd(prev);\r\n }\r\n return res;\r\n}\r\nfunction allowStateChangesStart(allowStateChanges) {\r\n var prev = globalState.allowStateChanges;\r\n globalState.allowStateChanges = allowStateChanges;\r\n return prev;\r\n}\r\nfunction allowStateChangesEnd(prev) {\r\n globalState.allowStateChanges = prev;\r\n}\r\nfunction allowStateChangesInsideComputed(func) {\r\n var prev = globalState.computationDepth;\r\n globalState.computationDepth = 0;\r\n var res;\r\n try {\r\n res = func();\r\n }\r\n finally {\r\n globalState.computationDepth = prev;\r\n }\r\n return res;\r\n}\n\nvar ObservableValue = /** @class */ (function (_super) {\r\n __extends(ObservableValue, _super);\r\n function ObservableValue(value, enhancer, name, notifySpy, equals) {\r\n if (name === void 0) { name = \"ObservableValue@\" + getNextId(); }\r\n if (notifySpy === void 0) { notifySpy = true; }\r\n if (equals === void 0) { equals = comparer.default; }\r\n var _this = _super.call(this, name) || this;\r\n _this.enhancer = enhancer;\r\n _this.name = name;\r\n _this.equals = equals;\r\n _this.hasUnreportedChange = false;\r\n _this.value = enhancer(value, undefined, name);\r\n if (notifySpy && isSpyEnabled() && process.env.NODE_ENV !== \"production\") {\r\n // only notify spy if this is a stand-alone observable\r\n spyReport({ type: \"create\", name: _this.name, newValue: \"\" + _this.value });\r\n }\r\n return _this;\r\n }\r\n ObservableValue.prototype.dehanceValue = function (value) {\r\n if (this.dehancer !== undefined)\r\n return this.dehancer(value);\r\n return value;\r\n };\r\n ObservableValue.prototype.set = function (newValue) {\r\n var oldValue = this.value;\r\n newValue = this.prepareNewValue(newValue);\r\n if (newValue !== globalState.UNCHANGED) {\r\n var notifySpy = isSpyEnabled();\r\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\r\n spyReportStart({\r\n type: \"update\",\r\n name: this.name,\r\n newValue: newValue,\r\n oldValue: oldValue\r\n });\r\n }\r\n this.setNewValue(newValue);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n }\r\n };\r\n ObservableValue.prototype.prepareNewValue = function (newValue) {\r\n checkIfStateModificationsAreAllowed(this);\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n object: this,\r\n type: \"update\",\r\n newValue: newValue\r\n });\r\n if (!change)\r\n return globalState.UNCHANGED;\r\n newValue = change.newValue;\r\n }\r\n // apply modifier\r\n newValue = this.enhancer(newValue, this.value, this.name);\r\n return this.equals(this.value, newValue) ? globalState.UNCHANGED : newValue;\r\n };\r\n ObservableValue.prototype.setNewValue = function (newValue) {\r\n var oldValue = this.value;\r\n this.value = newValue;\r\n this.reportChanged();\r\n if (hasListeners(this)) {\r\n notifyListeners(this, {\r\n type: \"update\",\r\n object: this,\r\n newValue: newValue,\r\n oldValue: oldValue\r\n });\r\n }\r\n };\r\n ObservableValue.prototype.get = function () {\r\n this.reportObserved();\r\n return this.dehanceValue(this.value);\r\n };\r\n ObservableValue.prototype.intercept = function (handler) {\r\n return registerInterceptor(this, handler);\r\n };\r\n ObservableValue.prototype.observe = function (listener, fireImmediately) {\r\n if (fireImmediately)\r\n listener({\r\n object: this,\r\n type: \"update\",\r\n newValue: this.value,\r\n oldValue: undefined\r\n });\r\n return registerListener(this, listener);\r\n };\r\n ObservableValue.prototype.toJSON = function () {\r\n return this.get();\r\n };\r\n ObservableValue.prototype.toString = function () {\r\n return this.name + \"[\" + this.value + \"]\";\r\n };\r\n ObservableValue.prototype.valueOf = function () {\r\n return toPrimitive(this.get());\r\n };\r\n ObservableValue.prototype[Symbol.toPrimitive] = function () {\r\n return this.valueOf();\r\n };\r\n return ObservableValue;\r\n}(Atom));\r\nvar isObservableValue = createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\r\nvar ComputedValue = /** @class */ (function () {\r\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structualComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\r\n function ComputedValue(options) {\r\n this.dependenciesState = IDerivationState.NOT_TRACKING;\r\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\r\n this.newObserving = null; // during tracking it's an array with new observed observers\r\n this.isBeingObserved = false;\r\n this.isPendingUnobservation = false;\r\n this.observers = new Set();\r\n this.diffValue = 0;\r\n this.runId = 0;\r\n this.lastAccessedBy = 0;\r\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\r\n this.unboundDepsCount = 0;\r\n this.__mapid = \"#\" + getNextId();\r\n this.value = new CaughtException(null);\r\n this.isComputing = false; // to check for cycles\r\n this.isRunningSetter = false;\r\n this.isTracing = TraceMode.NONE;\r\n invariant(options.get, \"missing option for computed: get\");\r\n this.derivation = options.get;\r\n this.name = options.name || \"ComputedValue@\" + getNextId();\r\n if (options.set)\r\n this.setter = createAction(this.name + \"-setter\", options.set);\r\n this.equals =\r\n options.equals ||\r\n (options.compareStructural || options.struct\r\n ? comparer.structural\r\n : comparer.default);\r\n this.scope = options.context;\r\n this.requiresReaction = !!options.requiresReaction;\r\n this.keepAlive = !!options.keepAlive;\r\n }\r\n ComputedValue.prototype.onBecomeStale = function () {\r\n propagateMaybeChanged(this);\r\n };\r\n ComputedValue.prototype.onBecomeObserved = function () {\r\n if (this.onBecomeObservedListeners) {\r\n this.onBecomeObservedListeners.forEach(function (listener) { return listener(); });\r\n }\r\n };\r\n ComputedValue.prototype.onBecomeUnobserved = function () {\r\n if (this.onBecomeUnobservedListeners) {\r\n this.onBecomeUnobservedListeners.forEach(function (listener) { return listener(); });\r\n }\r\n };\r\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\r\n ComputedValue.prototype.get = function () {\r\n if (this.isComputing)\r\n fail(\"Cycle detected in computation \" + this.name + \": \" + this.derivation);\r\n if (globalState.inBatch === 0 && this.observers.size === 0 && !this.keepAlive) {\r\n if (shouldCompute(this)) {\r\n this.warnAboutUntrackedRead();\r\n startBatch(); // See perf test 'computed memoization'\r\n this.value = this.computeValue(false);\r\n endBatch();\r\n }\r\n }\r\n else {\r\n reportObserved(this);\r\n if (shouldCompute(this))\r\n if (this.trackAndCompute())\r\n propagateChangeConfirmed(this);\r\n }\r\n var result = this.value;\r\n if (isCaughtException(result))\r\n throw result.cause;\r\n return result;\r\n };\r\n ComputedValue.prototype.peek = function () {\r\n var res = this.computeValue(false);\r\n if (isCaughtException(res))\r\n throw res.cause;\r\n return res;\r\n };\r\n ComputedValue.prototype.set = function (value) {\r\n if (this.setter) {\r\n invariant(!this.isRunningSetter, \"The setter of computed value '\" + this.name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\");\r\n this.isRunningSetter = true;\r\n try {\r\n this.setter.call(this.scope, value);\r\n }\r\n finally {\r\n this.isRunningSetter = false;\r\n }\r\n }\r\n else\r\n invariant(false, process.env.NODE_ENV !== \"production\" &&\r\n \"[ComputedValue '\" + this.name + \"'] It is not possible to assign a new value to a computed value.\");\r\n };\r\n ComputedValue.prototype.trackAndCompute = function () {\r\n if (isSpyEnabled() && process.env.NODE_ENV !== \"production\") {\r\n spyReport({\r\n object: this.scope,\r\n type: \"compute\",\r\n name: this.name\r\n });\r\n }\r\n var oldValue = this.value;\r\n var wasSuspended = \r\n /* see #1208 */ this.dependenciesState === IDerivationState.NOT_TRACKING;\r\n var newValue = this.computeValue(true);\r\n var changed = wasSuspended ||\r\n isCaughtException(oldValue) ||\r\n isCaughtException(newValue) ||\r\n !this.equals(oldValue, newValue);\r\n if (changed) {\r\n this.value = newValue;\r\n }\r\n return changed;\r\n };\r\n ComputedValue.prototype.computeValue = function (track) {\r\n this.isComputing = true;\r\n globalState.computationDepth++;\r\n var res;\r\n if (track) {\r\n res = trackDerivedFunction(this, this.derivation, this.scope);\r\n }\r\n else {\r\n if (globalState.disableErrorBoundaries === true) {\r\n res = this.derivation.call(this.scope);\r\n }\r\n else {\r\n try {\r\n res = this.derivation.call(this.scope);\r\n }\r\n catch (e) {\r\n res = new CaughtException(e);\r\n }\r\n }\r\n }\r\n globalState.computationDepth--;\r\n this.isComputing = false;\r\n return res;\r\n };\r\n ComputedValue.prototype.suspend = function () {\r\n if (!this.keepAlive) {\r\n clearObserving(this);\r\n this.value = undefined; // don't hold on to computed value!\r\n }\r\n };\r\n ComputedValue.prototype.observe = function (listener, fireImmediately) {\r\n var _this = this;\r\n var firstTime = true;\r\n var prevValue = undefined;\r\n return autorun(function () {\r\n var newValue = _this.get();\r\n if (!firstTime || fireImmediately) {\r\n var prevU = untrackedStart();\r\n listener({\r\n type: \"update\",\r\n object: _this,\r\n newValue: newValue,\r\n oldValue: prevValue\r\n });\r\n untrackedEnd(prevU);\r\n }\r\n firstTime = false;\r\n prevValue = newValue;\r\n });\r\n };\r\n ComputedValue.prototype.warnAboutUntrackedRead = function () {\r\n if (process.env.NODE_ENV === \"production\")\r\n return;\r\n if (this.requiresReaction === true) {\r\n fail(\"[mobx] Computed value \" + this.name + \" is read outside a reactive context\");\r\n }\r\n if (this.isTracing !== TraceMode.NONE) {\r\n console.log(\"[mobx.trace] '\" + this.name + \"' is being read outside a reactive context. Doing a full recompute\");\r\n }\r\n if (globalState.computedRequiresReaction) {\r\n console.warn(\"[mobx] Computed value \" + this.name + \" is being read outside a reactive context. Doing a full recompute\");\r\n }\r\n };\r\n ComputedValue.prototype.toJSON = function () {\r\n return this.get();\r\n };\r\n ComputedValue.prototype.toString = function () {\r\n return this.name + \"[\" + this.derivation.toString() + \"]\";\r\n };\r\n ComputedValue.prototype.valueOf = function () {\r\n return toPrimitive(this.get());\r\n };\r\n ComputedValue.prototype[Symbol.toPrimitive] = function () {\r\n return this.valueOf();\r\n };\r\n return ComputedValue;\r\n}());\r\nvar isComputedValue = createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\n/**\r\n * These values will persist if global state is reset\r\n */\r\nvar persistentKeys = [\r\n \"mobxGuid\",\r\n \"spyListeners\",\r\n \"enforceActions\",\r\n \"computedRequiresReaction\",\r\n \"reactionRequiresObservable\",\r\n \"observableRequiresReaction\",\r\n \"allowStateReads\",\r\n \"disableErrorBoundaries\",\r\n \"runId\",\r\n \"UNCHANGED\"\r\n];\r\nvar MobXGlobals = /** @class */ (function () {\r\n function MobXGlobals() {\r\n /**\r\n * MobXGlobals version.\r\n * MobX compatiblity with other versions loaded in memory as long as this version matches.\r\n * It indicates that the global state still stores similar information\r\n *\r\n * N.B: this version is unrelated to the package version of MobX, and is only the version of the\r\n * internal state storage of MobX, and can be the same across many different package versions\r\n */\r\n this.version = 5;\r\n /**\r\n * globally unique token to signal unchanged\r\n */\r\n this.UNCHANGED = {};\r\n /**\r\n * Currently running derivation\r\n */\r\n this.trackingDerivation = null;\r\n /**\r\n * Are we running a computation currently? (not a reaction)\r\n */\r\n this.computationDepth = 0;\r\n /**\r\n * Each time a derivation is tracked, it is assigned a unique run-id\r\n */\r\n this.runId = 0;\r\n /**\r\n * 'guid' for general purpose. Will be persisted amongst resets.\r\n */\r\n this.mobxGuid = 0;\r\n /**\r\n * Are we in a batch block? (and how many of them)\r\n */\r\n this.inBatch = 0;\r\n /**\r\n * Observables that don't have observers anymore, and are about to be\r\n * suspended, unless somebody else accesses it in the same batch\r\n *\r\n * @type {IObservable[]}\r\n */\r\n this.pendingUnobservations = [];\r\n /**\r\n * List of scheduled, not yet executed, reactions.\r\n */\r\n this.pendingReactions = [];\r\n /**\r\n * Are we currently processing reactions?\r\n */\r\n this.isRunningReactions = false;\r\n /**\r\n * Is it allowed to change observables at this point?\r\n * In general, MobX doesn't allow that when running computations and React.render.\r\n * To ensure that those functions stay pure.\r\n */\r\n this.allowStateChanges = true;\r\n /**\r\n * Is it allowed to read observables at this point?\r\n * Used to hold the state needed for `observableRequiresReaction`\r\n */\r\n this.allowStateReads = true;\r\n /**\r\n * If strict mode is enabled, state changes are by default not allowed\r\n */\r\n this.enforceActions = false;\r\n /**\r\n * Spy callbacks\r\n */\r\n this.spyListeners = [];\r\n /**\r\n * Globally attached error handlers that react specifically to errors in reactions\r\n */\r\n this.globalReactionErrorHandlers = [];\r\n /**\r\n * Warn if computed values are accessed outside a reactive context\r\n */\r\n this.computedRequiresReaction = false;\r\n /**\r\n * (Experimental)\r\n * Warn if you try to create to derivation / reactive context without accessing any observable.\r\n */\r\n this.reactionRequiresObservable = false;\r\n /**\r\n * (Experimental)\r\n * Warn if observables are accessed outside a reactive context\r\n */\r\n this.observableRequiresReaction = false;\r\n /**\r\n * Allows overwriting of computed properties, useful in tests but not prod as it can cause\r\n * memory leaks. See https://github.com/mobxjs/mobx/issues/1867\r\n */\r\n this.computedConfigurable = false;\r\n /*\r\n * Don't catch and rethrow exceptions. This is useful for inspecting the state of\r\n * the stack when an exception occurs while debugging.\r\n */\r\n this.disableErrorBoundaries = false;\r\n /*\r\n * If true, we are already handling an exception in an action. Any errors in reactions should be suppressed, as\r\n * they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836\r\n */\r\n this.suppressReactionErrors = false;\r\n }\r\n return MobXGlobals;\r\n}());\r\nvar mockGlobal = {};\r\nfunction getGlobal() {\r\n if (typeof window !== \"undefined\") {\r\n return window;\r\n }\r\n if (typeof global !== \"undefined\") {\r\n return global;\r\n }\r\n if (typeof self !== \"undefined\") {\r\n return self;\r\n }\r\n return mockGlobal;\r\n}\r\nvar canMergeGlobalState = true;\r\nvar isolateCalled = false;\r\nvar globalState = (function () {\r\n var global = getGlobal();\r\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals)\r\n canMergeGlobalState = false;\r\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version)\r\n canMergeGlobalState = false;\r\n if (!canMergeGlobalState) {\r\n setTimeout(function () {\r\n if (!isolateCalled) {\r\n fail(\"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\");\r\n }\r\n }, 1);\r\n return new MobXGlobals();\r\n }\r\n else if (global.__mobxGlobals) {\r\n global.__mobxInstanceCount += 1;\r\n if (!global.__mobxGlobals.UNCHANGED)\r\n global.__mobxGlobals.UNCHANGED = {}; // make merge backward compatible\r\n return global.__mobxGlobals;\r\n }\r\n else {\r\n global.__mobxInstanceCount = 1;\r\n return (global.__mobxGlobals = new MobXGlobals());\r\n }\r\n})();\r\nfunction isolateGlobalState() {\r\n if (globalState.pendingReactions.length ||\r\n globalState.inBatch ||\r\n globalState.isRunningReactions)\r\n fail(\"isolateGlobalState should be called before MobX is running any reactions\");\r\n isolateCalled = true;\r\n if (canMergeGlobalState) {\r\n if (--getGlobal().__mobxInstanceCount === 0)\r\n getGlobal().__mobxGlobals = undefined;\r\n globalState = new MobXGlobals();\r\n }\r\n}\r\nfunction getGlobalState() {\r\n return globalState;\r\n}\r\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\r\nfunction resetGlobalState() {\r\n var defaultGlobals = new MobXGlobals();\r\n for (var key in defaultGlobals)\r\n if (persistentKeys.indexOf(key) === -1)\r\n globalState[key] = defaultGlobals[key];\r\n globalState.allowStateChanges = !globalState.enforceActions;\r\n}\n\nfunction hasObservers(observable) {\r\n return observable.observers && observable.observers.size > 0;\r\n}\r\nfunction getObservers(observable) {\r\n return observable.observers;\r\n}\r\n// function invariantObservers(observable: IObservable) {\r\n// const list = observable.observers\r\n// const map = observable.observersIndexes\r\n// const l = list.length\r\n// for (let i = 0; i < l; i++) {\r\n// const id = list[i].__mapid\r\n// if (i) {\r\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\r\n// } else {\r\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\r\n// }\r\n// }\r\n// invariant(\r\n// list.length === 0 || Object.keys(map).length === list.length - 1,\r\n// \"INTERNAL ERROR there is no junk in map\"\r\n// )\r\n// }\r\nfunction addObserver(observable, node) {\r\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\r\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\r\n // invariantObservers(observable);\r\n observable.observers.add(node);\r\n if (observable.lowestObserverState > node.dependenciesState)\r\n observable.lowestObserverState = node.dependenciesState;\r\n // invariantObservers(observable);\r\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\r\n}\r\nfunction removeObserver(observable, node) {\r\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\r\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\r\n // invariantObservers(observable);\r\n observable.observers.delete(node);\r\n if (observable.observers.size === 0) {\r\n // deleting last observer\r\n queueForUnobservation(observable);\r\n }\r\n // invariantObservers(observable);\r\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\r\n}\r\nfunction queueForUnobservation(observable) {\r\n if (observable.isPendingUnobservation === false) {\r\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\r\n observable.isPendingUnobservation = true;\r\n globalState.pendingUnobservations.push(observable);\r\n }\r\n}\r\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\r\nfunction startBatch() {\r\n globalState.inBatch++;\r\n}\r\nfunction endBatch() {\r\n if (--globalState.inBatch === 0) {\r\n runReactions();\r\n // the batch is actually about to finish, all unobserving should happen here.\r\n var list = globalState.pendingUnobservations;\r\n for (var i = 0; i < list.length; i++) {\r\n var observable = list[i];\r\n observable.isPendingUnobservation = false;\r\n if (observable.observers.size === 0) {\r\n if (observable.isBeingObserved) {\r\n // if this observable had reactive observers, trigger the hooks\r\n observable.isBeingObserved = false;\r\n observable.onBecomeUnobserved();\r\n }\r\n if (observable instanceof ComputedValue) {\r\n // computed values are automatically teared down when the last observer leaves\r\n // this process happens recursively, this computed might be the last observabe of another, etc..\r\n observable.suspend();\r\n }\r\n }\r\n }\r\n globalState.pendingUnobservations = [];\r\n }\r\n}\r\nfunction reportObserved(observable) {\r\n checkIfStateReadsAreAllowed(observable);\r\n var derivation = globalState.trackingDerivation;\r\n if (derivation !== null) {\r\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\r\n if (derivation.runId !== observable.lastAccessedBy) {\r\n observable.lastAccessedBy = derivation.runId;\r\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\r\n derivation.newObserving[derivation.unboundDepsCount++] = observable;\r\n if (!observable.isBeingObserved) {\r\n observable.isBeingObserved = true;\r\n observable.onBecomeObserved();\r\n }\r\n }\r\n return true;\r\n }\r\n else if (observable.observers.size === 0 && globalState.inBatch > 0) {\r\n queueForUnobservation(observable);\r\n }\r\n return false;\r\n}\r\n// function invariantLOS(observable: IObservable, msg: string) {\r\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\r\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\r\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\r\n// throw new Error(\r\n// \"lowestObserverState is wrong for \" +\r\n// msg +\r\n// \" because \" +\r\n// min +\r\n// \" < \" +\r\n// observable.lowestObserverState\r\n// )\r\n// }\r\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\r\n// Called by Atom when its value changes\r\nfunction propagateChanged(observable) {\r\n // invariantLOS(observable, \"changed start\");\r\n if (observable.lowestObserverState === IDerivationState.STALE)\r\n return;\r\n observable.lowestObserverState = IDerivationState.STALE;\r\n // Ideally we use for..of here, but the downcompiled version is really slow...\r\n observable.observers.forEach(function (d) {\r\n if (d.dependenciesState === IDerivationState.UP_TO_DATE) {\r\n if (d.isTracing !== TraceMode.NONE) {\r\n logTraceInfo(d, observable);\r\n }\r\n d.onBecomeStale();\r\n }\r\n d.dependenciesState = IDerivationState.STALE;\r\n });\r\n // invariantLOS(observable, \"changed end\");\r\n}\r\n// Called by ComputedValue when it recalculate and its value changed\r\nfunction propagateChangeConfirmed(observable) {\r\n // invariantLOS(observable, \"confirmed start\");\r\n if (observable.lowestObserverState === IDerivationState.STALE)\r\n return;\r\n observable.lowestObserverState = IDerivationState.STALE;\r\n observable.observers.forEach(function (d) {\r\n if (d.dependenciesState === IDerivationState.POSSIBLY_STALE)\r\n d.dependenciesState = IDerivationState.STALE;\r\n else if (d.dependenciesState === IDerivationState.UP_TO_DATE // this happens during computing of `d`, just keep lowestObserverState up to date.\r\n )\r\n observable.lowestObserverState = IDerivationState.UP_TO_DATE;\r\n });\r\n // invariantLOS(observable, \"confirmed end\");\r\n}\r\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\r\nfunction propagateMaybeChanged(observable) {\r\n // invariantLOS(observable, \"maybe start\");\r\n if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE)\r\n return;\r\n observable.lowestObserverState = IDerivationState.POSSIBLY_STALE;\r\n observable.observers.forEach(function (d) {\r\n if (d.dependenciesState === IDerivationState.UP_TO_DATE) {\r\n d.dependenciesState = IDerivationState.POSSIBLY_STALE;\r\n if (d.isTracing !== TraceMode.NONE) {\r\n logTraceInfo(d, observable);\r\n }\r\n d.onBecomeStale();\r\n }\r\n });\r\n // invariantLOS(observable, \"maybe end\");\r\n}\r\nfunction logTraceInfo(derivation, observable) {\r\n console.log(\"[mobx.trace] '\" + derivation.name + \"' is invalidated due to a change in: '\" + observable.name + \"'\");\r\n if (derivation.isTracing === TraceMode.BREAK) {\r\n var lines = [];\r\n printDepTree(getDependencyTree(derivation), lines, 1);\r\n // prettier-ignore\r\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name + \"' is being traced and '\" + observable.name + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\r\n }\r\n}\r\nfunction printDepTree(tree, lines, depth) {\r\n if (lines.length >= 1000) {\r\n lines.push(\"(and many more)\");\r\n return;\r\n }\r\n lines.push(\"\" + new Array(depth).join(\"\\t\") + tree.name); // MWE: not the fastest, but the easiest way :)\r\n if (tree.dependencies)\r\n tree.dependencies.forEach(function (child) { return printDepTree(child, lines, depth + 1); });\r\n}\n\nvar Reaction = /** @class */ (function () {\r\n function Reaction(name, onInvalidate, errorHandler, requiresObservable) {\r\n if (name === void 0) { name = \"Reaction@\" + getNextId(); }\r\n if (requiresObservable === void 0) { requiresObservable = false; }\r\n this.name = name;\r\n this.onInvalidate = onInvalidate;\r\n this.errorHandler = errorHandler;\r\n this.requiresObservable = requiresObservable;\r\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\r\n this.newObserving = [];\r\n this.dependenciesState = IDerivationState.NOT_TRACKING;\r\n this.diffValue = 0;\r\n this.runId = 0;\r\n this.unboundDepsCount = 0;\r\n this.__mapid = \"#\" + getNextId();\r\n this.isDisposed = false;\r\n this._isScheduled = false;\r\n this._isTrackPending = false;\r\n this._isRunning = false;\r\n this.isTracing = TraceMode.NONE;\r\n }\r\n Reaction.prototype.onBecomeStale = function () {\r\n this.schedule();\r\n };\r\n Reaction.prototype.schedule = function () {\r\n if (!this._isScheduled) {\r\n this._isScheduled = true;\r\n globalState.pendingReactions.push(this);\r\n runReactions();\r\n }\r\n };\r\n Reaction.prototype.isScheduled = function () {\r\n return this._isScheduled;\r\n };\r\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\r\n Reaction.prototype.runReaction = function () {\r\n if (!this.isDisposed) {\r\n startBatch();\r\n this._isScheduled = false;\r\n if (shouldCompute(this)) {\r\n this._isTrackPending = true;\r\n try {\r\n this.onInvalidate();\r\n if (this._isTrackPending &&\r\n isSpyEnabled() &&\r\n process.env.NODE_ENV !== \"production\") {\r\n // onInvalidate didn't trigger track right away..\r\n spyReport({\r\n name: this.name,\r\n type: \"scheduled-reaction\"\r\n });\r\n }\r\n }\r\n catch (e) {\r\n this.reportExceptionInDerivation(e);\r\n }\r\n }\r\n endBatch();\r\n }\r\n };\r\n Reaction.prototype.track = function (fn) {\r\n if (this.isDisposed) {\r\n return;\r\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\r\n }\r\n startBatch();\r\n var notify = isSpyEnabled();\r\n var startTime;\r\n if (notify && process.env.NODE_ENV !== \"production\") {\r\n startTime = Date.now();\r\n spyReportStart({\r\n name: this.name,\r\n type: \"reaction\"\r\n });\r\n }\r\n this._isRunning = true;\r\n var result = trackDerivedFunction(this, fn, undefined);\r\n this._isRunning = false;\r\n this._isTrackPending = false;\r\n if (this.isDisposed) {\r\n // disposed during last run. Clean up everything that was bound after the dispose call.\r\n clearObserving(this);\r\n }\r\n if (isCaughtException(result))\r\n this.reportExceptionInDerivation(result.cause);\r\n if (notify && process.env.NODE_ENV !== \"production\") {\r\n spyReportEnd({\r\n time: Date.now() - startTime\r\n });\r\n }\r\n endBatch();\r\n };\r\n Reaction.prototype.reportExceptionInDerivation = function (error) {\r\n var _this = this;\r\n if (this.errorHandler) {\r\n this.errorHandler(error, this);\r\n return;\r\n }\r\n if (globalState.disableErrorBoundaries)\r\n throw error;\r\n var message = \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\";\r\n if (globalState.suppressReactionErrors) {\r\n console.warn(\"[mobx] (error in reaction '\" + this.name + \"' suppressed, fix error of causing action below)\"); // prettier-ignore\r\n }\r\n else {\r\n console.error(message, error);\r\n /** If debugging brought you here, please, read the above message :-). Tnx! */\r\n }\r\n if (isSpyEnabled()) {\r\n spyReport({\r\n type: \"error\",\r\n name: this.name,\r\n message: message,\r\n error: \"\" + error\r\n });\r\n }\r\n globalState.globalReactionErrorHandlers.forEach(function (f) { return f(error, _this); });\r\n };\r\n Reaction.prototype.dispose = function () {\r\n if (!this.isDisposed) {\r\n this.isDisposed = true;\r\n if (!this._isRunning) {\r\n // if disposed while running, clean up later. Maybe not optimal, but rare case\r\n startBatch();\r\n clearObserving(this);\r\n endBatch();\r\n }\r\n }\r\n };\r\n Reaction.prototype.getDisposer = function () {\r\n var r = this.dispose.bind(this);\r\n r[$mobx] = this;\r\n return r;\r\n };\r\n Reaction.prototype.toString = function () {\r\n return \"Reaction[\" + this.name + \"]\";\r\n };\r\n Reaction.prototype.trace = function (enterBreakPoint) {\r\n if (enterBreakPoint === void 0) { enterBreakPoint = false; }\r\n trace(this, enterBreakPoint);\r\n };\r\n return Reaction;\r\n}());\r\nfunction onReactionError(handler) {\r\n globalState.globalReactionErrorHandlers.push(handler);\r\n return function () {\r\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\r\n if (idx >= 0)\r\n globalState.globalReactionErrorHandlers.splice(idx, 1);\r\n };\r\n}\r\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\r\nvar MAX_REACTION_ITERATIONS = 100;\r\nvar reactionScheduler = function (f) { return f(); };\r\nfunction runReactions() {\r\n // Trampolining, if runReactions are already running, new reactions will be picked up\r\n if (globalState.inBatch > 0 || globalState.isRunningReactions)\r\n return;\r\n reactionScheduler(runReactionsHelper);\r\n}\r\nfunction runReactionsHelper() {\r\n globalState.isRunningReactions = true;\r\n var allReactions = globalState.pendingReactions;\r\n var iterations = 0;\r\n // While running reactions, new reactions might be triggered.\r\n // Hence we work with two variables and check whether\r\n // we converge to no remaining reactions after a while.\r\n while (allReactions.length > 0) {\r\n if (++iterations === MAX_REACTION_ITERATIONS) {\r\n console.error(\"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" +\r\n (\" Probably there is a cycle in the reactive function: \" + allReactions[0]));\r\n allReactions.splice(0); // clear reactions\r\n }\r\n var remainingReactions = allReactions.splice(0);\r\n for (var i = 0, l = remainingReactions.length; i < l; i++)\r\n remainingReactions[i].runReaction();\r\n }\r\n globalState.isRunningReactions = false;\r\n}\r\nvar isReaction = createInstanceofPredicate(\"Reaction\", Reaction);\r\nfunction setReactionScheduler(fn) {\r\n var baseScheduler = reactionScheduler;\r\n reactionScheduler = function (f) { return fn(function () { return baseScheduler(f); }); };\r\n}\n\nfunction isSpyEnabled() {\r\n return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\r\n}\r\nfunction spyReport(event) {\r\n if (process.env.NODE_ENV === \"production\")\r\n return; // dead code elimination can do the rest\r\n if (!globalState.spyListeners.length)\r\n return;\r\n var listeners = globalState.spyListeners;\r\n for (var i = 0, l = listeners.length; i < l; i++)\r\n listeners[i](event);\r\n}\r\nfunction spyReportStart(event) {\r\n if (process.env.NODE_ENV === \"production\")\r\n return;\r\n var change = __assign(__assign({}, event), { spyReportStart: true });\r\n spyReport(change);\r\n}\r\nvar END_EVENT = { spyReportEnd: true };\r\nfunction spyReportEnd(change) {\r\n if (process.env.NODE_ENV === \"production\")\r\n return;\r\n if (change)\r\n spyReport(__assign(__assign({}, change), { spyReportEnd: true }));\r\n else\r\n spyReport(END_EVENT);\r\n}\r\nfunction spy(listener) {\r\n if (process.env.NODE_ENV === \"production\") {\r\n console.warn(\"[mobx.spy] Is a no-op in production builds\");\r\n return function () { };\r\n }\r\n else {\r\n globalState.spyListeners.push(listener);\r\n return once(function () {\r\n globalState.spyListeners = globalState.spyListeners.filter(function (l) { return l !== listener; });\r\n });\r\n }\r\n}\n\nfunction dontReassignFields() {\r\n fail(process.env.NODE_ENV !== \"production\" && \"@action fields are not reassignable\");\r\n}\r\nfunction namedActionDecorator(name) {\r\n return function (target, prop, descriptor) {\r\n if (descriptor) {\r\n if (process.env.NODE_ENV !== \"production\" && descriptor.get !== undefined) {\r\n return fail(\"@action cannot be used with getters\");\r\n }\r\n // babel / typescript\r\n // @action method() { }\r\n if (descriptor.value) {\r\n // typescript\r\n return {\r\n value: createAction(name, descriptor.value),\r\n enumerable: false,\r\n configurable: true,\r\n writable: true // for typescript, this must be writable, otherwise it cannot inherit :/ (see inheritable actions test)\r\n };\r\n }\r\n // babel only: @action method = () => {}\r\n var initializer_1 = descriptor.initializer;\r\n return {\r\n enumerable: false,\r\n configurable: true,\r\n writable: true,\r\n initializer: function () {\r\n // N.B: we can't immediately invoke initializer; this would be wrong\r\n return createAction(name, initializer_1.call(this));\r\n }\r\n };\r\n }\r\n // bound instance methods\r\n return actionFieldDecorator(name).apply(this, arguments);\r\n };\r\n}\r\nfunction actionFieldDecorator(name) {\r\n // Simple property that writes on first invocation to the current instance\r\n return function (target, prop, descriptor) {\r\n Object.defineProperty(target, prop, {\r\n configurable: true,\r\n enumerable: false,\r\n get: function () {\r\n return undefined;\r\n },\r\n set: function (value) {\r\n addHiddenProp(this, prop, action(name, value));\r\n }\r\n });\r\n };\r\n}\r\nfunction boundActionDecorator(target, propertyName, descriptor, applyToInstance) {\r\n if (applyToInstance === true) {\r\n defineBoundAction(target, propertyName, descriptor.value);\r\n return null;\r\n }\r\n if (descriptor) {\r\n // if (descriptor.value)\r\n // Typescript / Babel: @action.bound method() { }\r\n // also: babel @action.bound method = () => {}\r\n return {\r\n configurable: true,\r\n enumerable: false,\r\n get: function () {\r\n defineBoundAction(this, propertyName, descriptor.value || descriptor.initializer.call(this));\r\n return this[propertyName];\r\n },\r\n set: dontReassignFields\r\n };\r\n }\r\n // field decorator Typescript @action.bound method = () => {}\r\n return {\r\n enumerable: false,\r\n configurable: true,\r\n set: function (v) {\r\n defineBoundAction(this, propertyName, v);\r\n },\r\n get: function () {\r\n return undefined;\r\n }\r\n };\r\n}\n\nvar action = function action(arg1, arg2, arg3, arg4) {\r\n // action(fn() {})\r\n if (arguments.length === 1 && typeof arg1 === \"function\")\r\n return createAction(arg1.name || \"\", arg1);\r\n // action(\"name\", fn() {})\r\n if (arguments.length === 2 && typeof arg2 === \"function\")\r\n return createAction(arg1, arg2);\r\n // @action(\"name\") fn() {}\r\n if (arguments.length === 1 && typeof arg1 === \"string\")\r\n return namedActionDecorator(arg1);\r\n // @action fn() {}\r\n if (arg4 === true) {\r\n // apply to instance immediately\r\n addHiddenProp(arg1, arg2, createAction(arg1.name || arg2, arg3.value, this));\r\n }\r\n else {\r\n return namedActionDecorator(arg2).apply(null, arguments);\r\n }\r\n};\r\naction.bound = boundActionDecorator;\r\nfunction runInAction(arg1, arg2) {\r\n var actionName = typeof arg1 === \"string\" ? arg1 : arg1.name || \"\";\r\n var fn = typeof arg1 === \"function\" ? arg1 : arg2;\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(typeof fn === \"function\" && fn.length === 0, \"`runInAction` expects a function without arguments\");\r\n if (typeof actionName !== \"string\" || !actionName)\r\n fail(\"actions should have valid names, got: '\" + actionName + \"'\");\r\n }\r\n return executeAction(actionName, fn, this, undefined);\r\n}\r\nfunction isAction(thing) {\r\n return typeof thing === \"function\" && thing.isMobxAction === true;\r\n}\r\nfunction defineBoundAction(target, propertyName, fn) {\r\n addHiddenProp(target, propertyName, createAction(propertyName, fn.bind(target)));\r\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\r\nfunction autorun(view, opts) {\r\n if (opts === void 0) { opts = EMPTY_OBJECT; }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(typeof view === \"function\", \"Autorun expects a function as first argument\");\r\n invariant(isAction(view) === false, \"Autorun does not accept actions since actions are untrackable\");\r\n }\r\n var name = (opts && opts.name) || view.name || \"Autorun@\" + getNextId();\r\n var runSync = !opts.scheduler && !opts.delay;\r\n var reaction;\r\n if (runSync) {\r\n // normal autorun\r\n reaction = new Reaction(name, function () {\r\n this.track(reactionRunner);\r\n }, opts.onError, opts.requiresObservable);\r\n }\r\n else {\r\n var scheduler_1 = createSchedulerFromOptions(opts);\r\n // debounced autorun\r\n var isScheduled_1 = false;\r\n reaction = new Reaction(name, function () {\r\n if (!isScheduled_1) {\r\n isScheduled_1 = true;\r\n scheduler_1(function () {\r\n isScheduled_1 = false;\r\n if (!reaction.isDisposed)\r\n reaction.track(reactionRunner);\r\n });\r\n }\r\n }, opts.onError, opts.requiresObservable);\r\n }\r\n function reactionRunner() {\r\n view(reaction);\r\n }\r\n reaction.schedule();\r\n return reaction.getDisposer();\r\n}\r\nvar run = function (f) { return f(); };\r\nfunction createSchedulerFromOptions(opts) {\r\n return opts.scheduler\r\n ? opts.scheduler\r\n : opts.delay\r\n ? function (f) { return setTimeout(f, opts.delay); }\r\n : run;\r\n}\r\nfunction reaction(expression, effect, opts) {\r\n if (opts === void 0) { opts = EMPTY_OBJECT; }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(typeof expression === \"function\", \"First argument to reaction should be a function\");\r\n invariant(typeof opts === \"object\", \"Third argument of reactions should be an object\");\r\n }\r\n var name = opts.name || \"Reaction@\" + getNextId();\r\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\r\n var runSync = !opts.scheduler && !opts.delay;\r\n var scheduler = createSchedulerFromOptions(opts);\r\n var firstTime = true;\r\n var isScheduled = false;\r\n var value;\r\n var equals = opts.compareStructural\r\n ? comparer.structural\r\n : opts.equals || comparer.default;\r\n var r = new Reaction(name, function () {\r\n if (firstTime || runSync) {\r\n reactionRunner();\r\n }\r\n else if (!isScheduled) {\r\n isScheduled = true;\r\n scheduler(reactionRunner);\r\n }\r\n }, opts.onError, opts.requiresObservable);\r\n function reactionRunner() {\r\n isScheduled = false; // Q: move into reaction runner?\r\n if (r.isDisposed)\r\n return;\r\n var changed = false;\r\n r.track(function () {\r\n var nextValue = expression(r);\r\n changed = firstTime || !equals(value, nextValue);\r\n value = nextValue;\r\n });\r\n if (firstTime && opts.fireImmediately)\r\n effectAction(value, r);\r\n if (!firstTime && changed === true)\r\n effectAction(value, r);\r\n if (firstTime)\r\n firstTime = false;\r\n }\r\n r.schedule();\r\n return r.getDisposer();\r\n}\r\nfunction wrapErrorHandler(errorHandler, baseFn) {\r\n return function () {\r\n try {\r\n return baseFn.apply(this, arguments);\r\n }\r\n catch (e) {\r\n errorHandler.call(this, e);\r\n }\r\n };\r\n}\n\nfunction onBecomeObserved(thing, arg2, arg3) {\r\n return interceptHook(\"onBecomeObserved\", thing, arg2, arg3);\r\n}\r\nfunction onBecomeUnobserved(thing, arg2, arg3) {\r\n return interceptHook(\"onBecomeUnobserved\", thing, arg2, arg3);\r\n}\r\nfunction interceptHook(hook, thing, arg2, arg3) {\r\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\r\n var cb = typeof arg3 === \"function\" ? arg3 : arg2;\r\n var listenersKey = hook + \"Listeners\";\r\n if (atom[listenersKey]) {\r\n atom[listenersKey].add(cb);\r\n }\r\n else {\r\n atom[listenersKey] = new Set([cb]);\r\n }\r\n var orig = atom[hook];\r\n if (typeof orig !== \"function\")\r\n return fail(process.env.NODE_ENV !== \"production\" && \"Not an atom that can be (un)observed\");\r\n return function () {\r\n var hookListeners = atom[listenersKey];\r\n if (hookListeners) {\r\n hookListeners.delete(cb);\r\n if (hookListeners.size === 0) {\r\n delete atom[listenersKey];\r\n }\r\n }\r\n };\r\n}\n\nfunction configure(options) {\r\n var enforceActions = options.enforceActions, computedRequiresReaction = options.computedRequiresReaction, computedConfigurable = options.computedConfigurable, disableErrorBoundaries = options.disableErrorBoundaries, reactionScheduler = options.reactionScheduler, reactionRequiresObservable = options.reactionRequiresObservable, observableRequiresReaction = options.observableRequiresReaction;\r\n if (options.isolateGlobalState === true) {\r\n isolateGlobalState();\r\n }\r\n if (enforceActions !== undefined) {\r\n if (typeof enforceActions === \"boolean\" || enforceActions === \"strict\")\r\n deprecated(\"Deprecated value for 'enforceActions', use 'false' => '\\\"never\\\"', 'true' => '\\\"observed\\\"', '\\\"strict\\\"' => \\\"'always'\\\" instead\");\r\n var ea = void 0;\r\n switch (enforceActions) {\r\n case true:\r\n case \"observed\":\r\n ea = true;\r\n break;\r\n case false:\r\n case \"never\":\r\n ea = false;\r\n break;\r\n case \"strict\":\r\n case \"always\":\r\n ea = \"strict\";\r\n break;\r\n default:\r\n fail(\"Invalid value for 'enforceActions': '\" + enforceActions + \"', expected 'never', 'always' or 'observed'\");\r\n }\r\n globalState.enforceActions = ea;\r\n globalState.allowStateChanges = ea === true || ea === \"strict\" ? false : true;\r\n }\r\n if (computedRequiresReaction !== undefined) {\r\n globalState.computedRequiresReaction = !!computedRequiresReaction;\r\n }\r\n if (reactionRequiresObservable !== undefined) {\r\n globalState.reactionRequiresObservable = !!reactionRequiresObservable;\r\n }\r\n if (observableRequiresReaction !== undefined) {\r\n globalState.observableRequiresReaction = !!observableRequiresReaction;\r\n globalState.allowStateReads = !globalState.observableRequiresReaction;\r\n }\r\n if (computedConfigurable !== undefined) {\r\n globalState.computedConfigurable = !!computedConfigurable;\r\n }\r\n if (disableErrorBoundaries !== undefined) {\r\n if (disableErrorBoundaries === true)\r\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\r\n globalState.disableErrorBoundaries = !!disableErrorBoundaries;\r\n }\r\n if (reactionScheduler) {\r\n setReactionScheduler(reactionScheduler);\r\n }\r\n}\n\nfunction decorate(thing, decorators) {\r\n process.env.NODE_ENV !== \"production\" &&\r\n invariant(isPlainObject(decorators), \"Decorators should be a key value map\");\r\n var target = typeof thing === \"function\" ? thing.prototype : thing;\r\n var _loop_1 = function (prop) {\r\n var propertyDecorators = decorators[prop];\r\n if (!Array.isArray(propertyDecorators)) {\r\n propertyDecorators = [propertyDecorators];\r\n }\r\n process.env.NODE_ENV !== \"production\" &&\r\n invariant(propertyDecorators.every(function (decorator) { return typeof decorator === \"function\"; }), \"Decorate: expected a decorator function or array of decorator functions for '\" + prop + \"'\");\r\n var descriptor = Object.getOwnPropertyDescriptor(target, prop);\r\n var newDescriptor = propertyDecorators.reduce(function (accDescriptor, decorator) { return decorator(target, prop, accDescriptor); }, descriptor);\r\n if (newDescriptor)\r\n Object.defineProperty(target, prop, newDescriptor);\r\n };\r\n for (var prop in decorators) {\r\n _loop_1(prop);\r\n }\r\n return thing;\r\n}\n\nfunction extendObservable(target, properties, decorators, options) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(arguments.length >= 2 && arguments.length <= 4, \"'extendObservable' expected 2-4 arguments\");\r\n invariant(typeof target === \"object\", \"'extendObservable' expects an object as first argument\");\r\n invariant(!isObservableMap(target), \"'extendObservable' should not be used on maps, use map.merge instead\");\r\n }\r\n options = asCreateObservableOptions(options);\r\n var defaultDecorator = getDefaultDecoratorFromObjectOptions(options);\r\n initializeInstance(target); // Fixes #1740\r\n asObservableObject(target, options.name, defaultDecorator.enhancer); // make sure object is observable, even without initial props\r\n if (properties)\r\n extendObservableObjectWithProperties(target, properties, decorators, defaultDecorator);\r\n return target;\r\n}\r\nfunction getDefaultDecoratorFromObjectOptions(options) {\r\n return options.defaultDecorator || (options.deep === false ? refDecorator : deepDecorator);\r\n}\r\nfunction extendObservableObjectWithProperties(target, properties, decorators, defaultDecorator) {\r\n var e_1, _a, e_2, _b;\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(!isObservable(properties), \"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540\");\r\n if (decorators) {\r\n var keys = getPlainObjectKeys(decorators);\r\n try {\r\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\r\n var key = keys_1_1.value;\r\n if (!(key in properties))\r\n fail(\"Trying to declare a decorator for unspecified property '\" + stringifyKey(key) + \"'\");\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n }\r\n startBatch();\r\n try {\r\n var keys = getPlainObjectKeys(properties);\r\n try {\r\n for (var keys_2 = __values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) {\r\n var key = keys_2_1.value;\r\n var descriptor = Object.getOwnPropertyDescriptor(properties, key);\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (!isPlainObject(properties))\r\n fail(\"'extendObservabe' only accepts plain objects as second argument\");\r\n if (isComputed(descriptor.value))\r\n fail(\"Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead\");\r\n }\r\n var decorator = decorators && key in decorators\r\n ? decorators[key]\r\n : descriptor.get\r\n ? computedDecorator\r\n : defaultDecorator;\r\n if (process.env.NODE_ENV !== \"production\" && typeof decorator !== \"function\")\r\n fail(\"Not a valid decorator for '\" + stringifyKey(key) + \"', got: \" + decorator);\r\n var resultDescriptor = decorator(target, key, descriptor, true);\r\n if (resultDescriptor // otherwise, assume already applied, due to `applyToInstance`\r\n )\r\n Object.defineProperty(target, key, resultDescriptor);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (keys_2_1 && !keys_2_1.done && (_b = keys_2.return)) _b.call(keys_2);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n }\r\n finally {\r\n endBatch();\r\n }\r\n}\n\nfunction getDependencyTree(thing, property) {\r\n return nodeToDependencyTree(getAtom(thing, property));\r\n}\r\nfunction nodeToDependencyTree(node) {\r\n var result = {\r\n name: node.name\r\n };\r\n if (node.observing && node.observing.length > 0)\r\n result.dependencies = unique(node.observing).map(nodeToDependencyTree);\r\n return result;\r\n}\r\nfunction getObserverTree(thing, property) {\r\n return nodeToObserverTree(getAtom(thing, property));\r\n}\r\nfunction nodeToObserverTree(node) {\r\n var result = {\r\n name: node.name\r\n };\r\n if (hasObservers(node))\r\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\r\n return result;\r\n}\n\nvar generatorId = 0;\r\nfunction FlowCancellationError() {\r\n this.message = \"FLOW_CANCELLED\";\r\n}\r\nFlowCancellationError.prototype = Object.create(Error.prototype);\r\nfunction isFlowCancellationError(error) {\r\n return error instanceof FlowCancellationError;\r\n}\r\nfunction flow(generator) {\r\n if (arguments.length !== 1)\r\n fail(!!process.env.NODE_ENV && \"Flow expects 1 argument and cannot be used as decorator\");\r\n var name = generator.name || \"\";\r\n // Implementation based on https://github.com/tj/co/blob/master/index.js\r\n return function () {\r\n var ctx = this;\r\n var args = arguments;\r\n var runId = ++generatorId;\r\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\r\n var rejector;\r\n var pendingPromise = undefined;\r\n var promise = new Promise(function (resolve, reject) {\r\n var stepId = 0;\r\n rejector = reject;\r\n function onFulfilled(res) {\r\n pendingPromise = undefined;\r\n var ret;\r\n try {\r\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\r\n }\r\n catch (e) {\r\n return reject(e);\r\n }\r\n next(ret);\r\n }\r\n function onRejected(err) {\r\n pendingPromise = undefined;\r\n var ret;\r\n try {\r\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.throw).call(gen, err);\r\n }\r\n catch (e) {\r\n return reject(e);\r\n }\r\n next(ret);\r\n }\r\n function next(ret) {\r\n if (ret && typeof ret.then === \"function\") {\r\n // an async iterator\r\n ret.then(next, reject);\r\n return;\r\n }\r\n if (ret.done)\r\n return resolve(ret.value);\r\n pendingPromise = Promise.resolve(ret.value);\r\n return pendingPromise.then(onFulfilled, onRejected);\r\n }\r\n onFulfilled(undefined); // kick off the process\r\n });\r\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\r\n try {\r\n if (pendingPromise)\r\n cancelPromise(pendingPromise);\r\n // Finally block can return (or yield) stuff..\r\n var res = gen.return(undefined);\r\n // eat anything that promise would do, it's cancelled!\r\n var yieldedPromise = Promise.resolve(res.value);\r\n yieldedPromise.then(noop, noop);\r\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\r\n // reject our original promise\r\n rejector(new FlowCancellationError());\r\n }\r\n catch (e) {\r\n rejector(e); // there could be a throwing finally block\r\n }\r\n });\r\n return promise;\r\n };\r\n}\r\nfunction cancelPromise(promise) {\r\n if (typeof promise.cancel === \"function\")\r\n promise.cancel();\r\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\r\n var target;\r\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\r\n target = getAdministration(thing);\r\n }\r\n else if (isObservableObject(thing)) {\r\n if (typeof propOrHandler !== \"string\")\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"InterceptReads can only be used with a specific property, not with an object in general\");\r\n target = getAdministration(thing, propOrHandler);\r\n }\r\n else {\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"Expected observable map, object or array as first array\");\r\n }\r\n if (target.dehancer !== undefined)\r\n return fail(process.env.NODE_ENV !== \"production\" && \"An intercept reader was already established\");\r\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\r\n return function () {\r\n target.dehancer = undefined;\r\n };\r\n}\n\nfunction intercept(thing, propOrHandler, handler) {\r\n if (typeof handler === \"function\")\r\n return interceptProperty(thing, propOrHandler, handler);\r\n else\r\n return interceptInterceptable(thing, propOrHandler);\r\n}\r\nfunction interceptInterceptable(thing, handler) {\r\n return getAdministration(thing).intercept(handler);\r\n}\r\nfunction interceptProperty(thing, property, handler) {\r\n return getAdministration(thing, property).intercept(handler);\r\n}\n\nfunction _isComputed(value, property) {\r\n if (value === null || value === undefined)\r\n return false;\r\n if (property !== undefined) {\r\n if (isObservableObject(value) === false)\r\n return false;\r\n if (!value[$mobx].values.has(property))\r\n return false;\r\n var atom = getAtom(value, property);\r\n return isComputedValue(atom);\r\n }\r\n return isComputedValue(value);\r\n}\r\nfunction isComputed(value) {\r\n if (arguments.length > 1)\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\r\n return _isComputed(value);\r\n}\r\nfunction isComputedProp(value, propName) {\r\n if (typeof propName !== \"string\")\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"isComputed expected a property name as second argument\");\r\n return _isComputed(value, propName);\r\n}\n\nfunction _isObservable(value, property) {\r\n if (value === null || value === undefined)\r\n return false;\r\n if (property !== undefined) {\r\n if (process.env.NODE_ENV !== \"production\" &&\r\n (isObservableMap(value) || isObservableArray(value)))\r\n return fail(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\r\n if (isObservableObject(value)) {\r\n return value[$mobx].values.has(property);\r\n }\r\n return false;\r\n }\r\n // For first check, see #701\r\n return (isObservableObject(value) ||\r\n !!value[$mobx] ||\r\n isAtom(value) ||\r\n isReaction(value) ||\r\n isComputedValue(value));\r\n}\r\nfunction isObservable(value) {\r\n if (arguments.length !== 1)\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n \"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\r\n return _isObservable(value);\r\n}\r\nfunction isObservableProp(value, propName) {\r\n if (typeof propName !== \"string\")\r\n return fail(process.env.NODE_ENV !== \"production\" && \"expected a property name as second argument\");\r\n return _isObservable(value, propName);\r\n}\n\nfunction keys(obj) {\r\n if (isObservableObject(obj)) {\r\n return obj[$mobx].getKeys();\r\n }\r\n if (isObservableMap(obj)) {\r\n return Array.from(obj.keys());\r\n }\r\n if (isObservableSet(obj)) {\r\n return Array.from(obj.keys());\r\n }\r\n if (isObservableArray(obj)) {\r\n return obj.map(function (_, index) { return index; });\r\n }\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'keys()' can only be used on observable objects, arrays, sets and maps\");\r\n}\r\nfunction values(obj) {\r\n if (isObservableObject(obj)) {\r\n return keys(obj).map(function (key) { return obj[key]; });\r\n }\r\n if (isObservableMap(obj)) {\r\n return keys(obj).map(function (key) { return obj.get(key); });\r\n }\r\n if (isObservableSet(obj)) {\r\n return Array.from(obj.values());\r\n }\r\n if (isObservableArray(obj)) {\r\n return obj.slice();\r\n }\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'values()' can only be used on observable objects, arrays, sets and maps\");\r\n}\r\nfunction entries(obj) {\r\n if (isObservableObject(obj)) {\r\n return keys(obj).map(function (key) { return [key, obj[key]]; });\r\n }\r\n if (isObservableMap(obj)) {\r\n return keys(obj).map(function (key) { return [key, obj.get(key)]; });\r\n }\r\n if (isObservableSet(obj)) {\r\n return Array.from(obj.entries());\r\n }\r\n if (isObservableArray(obj)) {\r\n return obj.map(function (key, index) { return [index, key]; });\r\n }\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'entries()' can only be used on observable objects, arrays and maps\");\r\n}\r\nfunction set(obj, key, value) {\r\n if (arguments.length === 2 && !isObservableSet(obj)) {\r\n startBatch();\r\n var values_1 = key;\r\n try {\r\n for (var key_1 in values_1)\r\n set(obj, key_1, values_1[key_1]);\r\n }\r\n finally {\r\n endBatch();\r\n }\r\n return;\r\n }\r\n if (isObservableObject(obj)) {\r\n var adm = obj[$mobx];\r\n var existingObservable = adm.values.get(key);\r\n if (existingObservable) {\r\n adm.write(key, value);\r\n }\r\n else {\r\n adm.addObservableProp(key, value, adm.defaultEnhancer);\r\n }\r\n }\r\n else if (isObservableMap(obj)) {\r\n obj.set(key, value);\r\n }\r\n else if (isObservableSet(obj)) {\r\n obj.add(key);\r\n }\r\n else if (isObservableArray(obj)) {\r\n if (typeof key !== \"number\")\r\n key = parseInt(key, 10);\r\n invariant(key >= 0, \"Not a valid index: '\" + key + \"'\");\r\n startBatch();\r\n if (key >= obj.length)\r\n obj.length = key + 1;\r\n obj[key] = value;\r\n endBatch();\r\n }\r\n else {\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'set()' can only be used on observable objects, arrays and maps\");\r\n }\r\n}\r\nfunction remove(obj, key) {\r\n if (isObservableObject(obj)) {\r\n obj[$mobx].remove(key);\r\n }\r\n else if (isObservableMap(obj)) {\r\n obj.delete(key);\r\n }\r\n else if (isObservableSet(obj)) {\r\n obj.delete(key);\r\n }\r\n else if (isObservableArray(obj)) {\r\n if (typeof key !== \"number\")\r\n key = parseInt(key, 10);\r\n invariant(key >= 0, \"Not a valid index: '\" + key + \"'\");\r\n obj.splice(key, 1);\r\n }\r\n else {\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'remove()' can only be used on observable objects, arrays and maps\");\r\n }\r\n}\r\nfunction has(obj, key) {\r\n if (isObservableObject(obj)) {\r\n // return keys(obj).indexOf(key) >= 0\r\n var adm = getAdministration(obj);\r\n return adm.has(key);\r\n }\r\n else if (isObservableMap(obj)) {\r\n return obj.has(key);\r\n }\r\n else if (isObservableSet(obj)) {\r\n return obj.has(key);\r\n }\r\n else if (isObservableArray(obj)) {\r\n return key >= 0 && key < obj.length;\r\n }\r\n else {\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'has()' can only be used on observable objects, arrays and maps\");\r\n }\r\n}\r\nfunction get(obj, key) {\r\n if (!has(obj, key))\r\n return undefined;\r\n if (isObservableObject(obj)) {\r\n return obj[key];\r\n }\r\n else if (isObservableMap(obj)) {\r\n return obj.get(key);\r\n }\r\n else if (isObservableArray(obj)) {\r\n return obj[key];\r\n }\r\n else {\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'get()' can only be used on observable objects, arrays and maps\");\r\n }\r\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\r\n if (typeof cbOrFire === \"function\")\r\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\r\n else\r\n return observeObservable(thing, propOrCb, cbOrFire);\r\n}\r\nfunction observeObservable(thing, listener, fireImmediately) {\r\n return getAdministration(thing).observe(listener, fireImmediately);\r\n}\r\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\r\n return getAdministration(thing, property).observe(listener, fireImmediately);\r\n}\n\nvar defaultOptions = {\r\n detectCycles: true,\r\n exportMapsAsObjects: true,\r\n recurseEverything: false\r\n};\r\nfunction cache(map, key, value, options) {\r\n if (options.detectCycles)\r\n map.set(key, value);\r\n return value;\r\n}\r\nfunction toJSHelper(source, options, __alreadySeen) {\r\n if (!options.recurseEverything && !isObservable(source))\r\n return source;\r\n if (typeof source !== \"object\")\r\n return source;\r\n // Directly return null if source is null\r\n if (source === null)\r\n return null;\r\n // Directly return the Date object itself if contained in the observable\r\n if (source instanceof Date)\r\n return source;\r\n if (isObservableValue(source))\r\n return toJSHelper(source.get(), options, __alreadySeen);\r\n // make sure we track the keys of the object\r\n if (isObservable(source))\r\n keys(source);\r\n var detectCycles = options.detectCycles === true;\r\n if (detectCycles && source !== null && __alreadySeen.has(source)) {\r\n return __alreadySeen.get(source);\r\n }\r\n if (isObservableArray(source) || Array.isArray(source)) {\r\n var res_1 = cache(__alreadySeen, source, [], options);\r\n var toAdd = source.map(function (value) { return toJSHelper(value, options, __alreadySeen); });\r\n res_1.length = toAdd.length;\r\n for (var i = 0, l = toAdd.length; i < l; i++)\r\n res_1[i] = toAdd[i];\r\n return res_1;\r\n }\r\n if (isObservableSet(source) || Object.getPrototypeOf(source) === Set.prototype) {\r\n if (options.exportMapsAsObjects === false) {\r\n var res_2 = cache(__alreadySeen, source, new Set(), options);\r\n source.forEach(function (value) {\r\n res_2.add(toJSHelper(value, options, __alreadySeen));\r\n });\r\n return res_2;\r\n }\r\n else {\r\n var res_3 = cache(__alreadySeen, source, [], options);\r\n source.forEach(function (value) {\r\n res_3.push(toJSHelper(value, options, __alreadySeen));\r\n });\r\n return res_3;\r\n }\r\n }\r\n if (isObservableMap(source) || Object.getPrototypeOf(source) === Map.prototype) {\r\n if (options.exportMapsAsObjects === false) {\r\n var res_4 = cache(__alreadySeen, source, new Map(), options);\r\n source.forEach(function (value, key) {\r\n res_4.set(key, toJSHelper(value, options, __alreadySeen));\r\n });\r\n return res_4;\r\n }\r\n else {\r\n var res_5 = cache(__alreadySeen, source, {}, options);\r\n source.forEach(function (value, key) {\r\n res_5[key] = toJSHelper(value, options, __alreadySeen);\r\n });\r\n return res_5;\r\n }\r\n }\r\n // Fallback to the situation that source is an ObservableObject or a plain object\r\n var res = cache(__alreadySeen, source, {}, options);\r\n getPlainObjectKeys(source).forEach(function (key) {\r\n res[key] = toJSHelper(source[key], options, __alreadySeen);\r\n });\r\n return res;\r\n}\r\nfunction toJS(source, options) {\r\n // backward compatibility\r\n if (typeof options === \"boolean\")\r\n options = { detectCycles: options };\r\n if (!options)\r\n options = defaultOptions;\r\n options.detectCycles =\r\n options.detectCycles === undefined\r\n ? options.recurseEverything === true\r\n : options.detectCycles === true;\r\n var __alreadySeen;\r\n if (options.detectCycles)\r\n __alreadySeen = new Map();\r\n return toJSHelper(source, options, __alreadySeen);\r\n}\n\nfunction trace() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var enterBreakPoint = false;\r\n if (typeof args[args.length - 1] === \"boolean\")\r\n enterBreakPoint = args.pop();\r\n var derivation = getAtomFromArgs(args);\r\n if (!derivation) {\r\n return fail(process.env.NODE_ENV !== \"production\" &&\r\n \"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\r\n }\r\n if (derivation.isTracing === TraceMode.NONE) {\r\n console.log(\"[mobx.trace] '\" + derivation.name + \"' tracing enabled\");\r\n }\r\n derivation.isTracing = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\r\n}\r\nfunction getAtomFromArgs(args) {\r\n switch (args.length) {\r\n case 0:\r\n return globalState.trackingDerivation;\r\n case 1:\r\n return getAtom(args[0]);\r\n case 2:\r\n return getAtom(args[0], args[1]);\r\n }\r\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\r\nfunction transaction(action, thisArg) {\r\n if (thisArg === void 0) { thisArg = undefined; }\r\n startBatch();\r\n try {\r\n return action.apply(thisArg);\r\n }\r\n finally {\r\n endBatch();\r\n }\r\n}\n\nfunction when(predicate, arg1, arg2) {\r\n if (arguments.length === 1 || (arg1 && typeof arg1 === \"object\"))\r\n return whenPromise(predicate, arg1);\r\n return _when(predicate, arg1, arg2 || {});\r\n}\r\nfunction _when(predicate, effect, opts) {\r\n var timeoutHandle;\r\n if (typeof opts.timeout === \"number\") {\r\n timeoutHandle = setTimeout(function () {\r\n if (!disposer[$mobx].isDisposed) {\r\n disposer();\r\n var error = new Error(\"WHEN_TIMEOUT\");\r\n if (opts.onError)\r\n opts.onError(error);\r\n else\r\n throw error;\r\n }\r\n }, opts.timeout);\r\n }\r\n opts.name = opts.name || \"When@\" + getNextId();\r\n var effectAction = createAction(opts.name + \"-effect\", effect);\r\n var disposer = autorun(function (r) {\r\n if (predicate()) {\r\n r.dispose();\r\n if (timeoutHandle)\r\n clearTimeout(timeoutHandle);\r\n effectAction();\r\n }\r\n }, opts);\r\n return disposer;\r\n}\r\nfunction whenPromise(predicate, opts) {\r\n if (process.env.NODE_ENV !== \"production\" && opts && opts.onError)\r\n return fail(\"the options 'onError' and 'promise' cannot be combined\");\r\n var cancel;\r\n var res = new Promise(function (resolve, reject) {\r\n var disposer = _when(predicate, resolve, __assign(__assign({}, opts), { onError: reject }));\r\n cancel = function () {\r\n disposer();\r\n reject(\"WHEN_CANCELLED\");\r\n };\r\n });\r\n res.cancel = cancel;\r\n return res;\r\n}\n\nfunction getAdm(target) {\r\n return target[$mobx];\r\n}\r\nfunction isPropertyKey(val) {\r\n return typeof val === \"string\" || typeof val === \"number\" || typeof val === \"symbol\";\r\n}\r\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\r\n// and skip either the internal values map, or the base object with its property descriptors!\r\nvar objectProxyTraps = {\r\n has: function (target, name) {\r\n if (name === $mobx || name === \"constructor\" || name === mobxDidRunLazyInitializersSymbol)\r\n return true;\r\n var adm = getAdm(target);\r\n // MWE: should `in` operator be reactive? If not, below code path will be faster / more memory efficient\r\n // TODO: check performance stats!\r\n // if (adm.values.get(name as string)) return true\r\n if (isPropertyKey(name))\r\n return adm.has(name);\r\n return name in target;\r\n },\r\n get: function (target, name) {\r\n if (name === $mobx || name === \"constructor\" || name === mobxDidRunLazyInitializersSymbol)\r\n return target[name];\r\n var adm = getAdm(target);\r\n var observable = adm.values.get(name);\r\n if (observable instanceof Atom) {\r\n var result = observable.get();\r\n if (result === undefined) {\r\n // This fixes #1796, because deleting a prop that has an\r\n // undefined value won't retrigger a observer (no visible effect),\r\n // the autorun wouldn't subscribe to future key changes (see also next comment)\r\n adm.has(name);\r\n }\r\n return result;\r\n }\r\n // make sure we start listening to future keys\r\n // note that we only do this here for optimization\r\n if (isPropertyKey(name))\r\n adm.has(name);\r\n return target[name];\r\n },\r\n set: function (target, name, value) {\r\n if (!isPropertyKey(name))\r\n return false;\r\n set(target, name, value);\r\n return true;\r\n },\r\n deleteProperty: function (target, name) {\r\n if (!isPropertyKey(name))\r\n return false;\r\n var adm = getAdm(target);\r\n adm.remove(name);\r\n return true;\r\n },\r\n ownKeys: function (target) {\r\n var adm = getAdm(target);\r\n adm.keysAtom.reportObserved();\r\n return Reflect.ownKeys(target);\r\n },\r\n preventExtensions: function (target) {\r\n fail(\"Dynamic observable objects cannot be frozen\");\r\n return false;\r\n }\r\n};\r\nfunction createDynamicObservableObject(base) {\r\n var proxy = new Proxy(base, objectProxyTraps);\r\n base[$mobx].proxy = proxy;\r\n return proxy;\r\n}\n\nfunction hasInterceptors(interceptable) {\r\n return interceptable.interceptors !== undefined && interceptable.interceptors.length > 0;\r\n}\r\nfunction registerInterceptor(interceptable, handler) {\r\n var interceptors = interceptable.interceptors || (interceptable.interceptors = []);\r\n interceptors.push(handler);\r\n return once(function () {\r\n var idx = interceptors.indexOf(handler);\r\n if (idx !== -1)\r\n interceptors.splice(idx, 1);\r\n });\r\n}\r\nfunction interceptChange(interceptable, change) {\r\n var prevU = untrackedStart();\r\n try {\r\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\r\n var interceptors = __spread((interceptable.interceptors || []));\r\n for (var i = 0, l = interceptors.length; i < l; i++) {\r\n change = interceptors[i](change);\r\n invariant(!change || change.type, \"Intercept handlers should return nothing or a change object\");\r\n if (!change)\r\n break;\r\n }\r\n return change;\r\n }\r\n finally {\r\n untrackedEnd(prevU);\r\n }\r\n}\n\nfunction hasListeners(listenable) {\r\n return listenable.changeListeners !== undefined && listenable.changeListeners.length > 0;\r\n}\r\nfunction registerListener(listenable, handler) {\r\n var listeners = listenable.changeListeners || (listenable.changeListeners = []);\r\n listeners.push(handler);\r\n return once(function () {\r\n var idx = listeners.indexOf(handler);\r\n if (idx !== -1)\r\n listeners.splice(idx, 1);\r\n });\r\n}\r\nfunction notifyListeners(listenable, change) {\r\n var prevU = untrackedStart();\r\n var listeners = listenable.changeListeners;\r\n if (!listeners)\r\n return;\r\n listeners = listeners.slice();\r\n for (var i = 0, l = listeners.length; i < l; i++) {\r\n listeners[i](change);\r\n }\r\n untrackedEnd(prevU);\r\n}\n\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\r\nvar arrayTraps = {\r\n get: function (target, name) {\r\n if (name === $mobx)\r\n return target[$mobx];\r\n if (name === \"length\")\r\n return target[$mobx].getArrayLength();\r\n if (typeof name === \"number\") {\r\n return arrayExtensions.get.call(target, name);\r\n }\r\n if (typeof name === \"string\" && !isNaN(name)) {\r\n return arrayExtensions.get.call(target, parseInt(name));\r\n }\r\n if (arrayExtensions.hasOwnProperty(name)) {\r\n return arrayExtensions[name];\r\n }\r\n return target[name];\r\n },\r\n set: function (target, name, value) {\r\n if (name === \"length\") {\r\n target[$mobx].setArrayLength(value);\r\n }\r\n if (typeof name === \"number\") {\r\n arrayExtensions.set.call(target, name, value);\r\n }\r\n if (typeof name === \"symbol\" || isNaN(name)) {\r\n target[name] = value;\r\n }\r\n else {\r\n // numeric string\r\n arrayExtensions.set.call(target, parseInt(name), value);\r\n }\r\n return true;\r\n },\r\n preventExtensions: function (target) {\r\n fail(\"Observable arrays cannot be frozen\");\r\n return false;\r\n }\r\n};\r\nfunction createObservableArray(initialValues, enhancer, name, owned) {\r\n if (name === void 0) { name = \"ObservableArray@\" + getNextId(); }\r\n if (owned === void 0) { owned = false; }\r\n var adm = new ObservableArrayAdministration(name, enhancer, owned);\r\n addHiddenFinalProp(adm.values, $mobx, adm);\r\n var proxy = new Proxy(adm.values, arrayTraps);\r\n adm.proxy = proxy;\r\n if (initialValues && initialValues.length) {\r\n var prev = allowStateChangesStart(true);\r\n adm.spliceWithArray(0, 0, initialValues);\r\n allowStateChangesEnd(prev);\r\n }\r\n return proxy;\r\n}\r\nvar ObservableArrayAdministration = /** @class */ (function () {\r\n function ObservableArrayAdministration(name, enhancer, owned) {\r\n this.owned = owned;\r\n this.values = [];\r\n this.proxy = undefined;\r\n this.lastKnownLength = 0;\r\n this.atom = new Atom(name || \"ObservableArray@\" + getNextId());\r\n this.enhancer = function (newV, oldV) { return enhancer(newV, oldV, name + \"[..]\"); };\r\n }\r\n ObservableArrayAdministration.prototype.dehanceValue = function (value) {\r\n if (this.dehancer !== undefined)\r\n return this.dehancer(value);\r\n return value;\r\n };\r\n ObservableArrayAdministration.prototype.dehanceValues = function (values) {\r\n if (this.dehancer !== undefined && values.length > 0)\r\n return values.map(this.dehancer);\r\n return values;\r\n };\r\n ObservableArrayAdministration.prototype.intercept = function (handler) {\r\n return registerInterceptor(this, handler);\r\n };\r\n ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) {\r\n if (fireImmediately === void 0) { fireImmediately = false; }\r\n if (fireImmediately) {\r\n listener({\r\n object: this.proxy,\r\n type: \"splice\",\r\n index: 0,\r\n added: this.values.slice(),\r\n addedCount: this.values.length,\r\n removed: [],\r\n removedCount: 0\r\n });\r\n }\r\n return registerListener(this, listener);\r\n };\r\n ObservableArrayAdministration.prototype.getArrayLength = function () {\r\n this.atom.reportObserved();\r\n return this.values.length;\r\n };\r\n ObservableArrayAdministration.prototype.setArrayLength = function (newLength) {\r\n if (typeof newLength !== \"number\" || newLength < 0)\r\n throw new Error(\"[mobx.array] Out of range: \" + newLength);\r\n var currentLength = this.values.length;\r\n if (newLength === currentLength)\r\n return;\r\n else if (newLength > currentLength) {\r\n var newItems = new Array(newLength - currentLength);\r\n for (var i = 0; i < newLength - currentLength; i++)\r\n newItems[i] = undefined; // No Array.fill everywhere...\r\n this.spliceWithArray(currentLength, 0, newItems);\r\n }\r\n else\r\n this.spliceWithArray(newLength, currentLength - newLength);\r\n };\r\n ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) {\r\n if (oldLength !== this.lastKnownLength)\r\n throw new Error(\"[mobx] Modification exception: the internal structure of an observable array was changed.\");\r\n this.lastKnownLength += delta;\r\n };\r\n ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) {\r\n var _this = this;\r\n checkIfStateModificationsAreAllowed(this.atom);\r\n var length = this.values.length;\r\n if (index === undefined)\r\n index = 0;\r\n else if (index > length)\r\n index = length;\r\n else if (index < 0)\r\n index = Math.max(0, length + index);\r\n if (arguments.length === 1)\r\n deleteCount = length - index;\r\n else if (deleteCount === undefined || deleteCount === null)\r\n deleteCount = 0;\r\n else\r\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\r\n if (newItems === undefined)\r\n newItems = EMPTY_ARRAY;\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n object: this.proxy,\r\n type: \"splice\",\r\n index: index,\r\n removedCount: deleteCount,\r\n added: newItems\r\n });\r\n if (!change)\r\n return EMPTY_ARRAY;\r\n deleteCount = change.removedCount;\r\n newItems = change.added;\r\n }\r\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) { return _this.enhancer(v, undefined); });\r\n if (process.env.NODE_ENV !== \"production\") {\r\n var lengthDelta = newItems.length - deleteCount;\r\n this.updateArrayLength(length, lengthDelta); // checks if internal array wasn't modified\r\n }\r\n var res = this.spliceItemsIntoValues(index, deleteCount, newItems);\r\n if (deleteCount !== 0 || newItems.length !== 0)\r\n this.notifyArraySplice(index, newItems, res);\r\n return this.dehanceValues(res);\r\n };\r\n ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) {\r\n var _a;\r\n if (newItems.length < MAX_SPLICE_SIZE) {\r\n return (_a = this.values).splice.apply(_a, __spread([index, deleteCount], newItems));\r\n }\r\n else {\r\n var res = this.values.slice(index, index + deleteCount);\r\n this.values = this.values\r\n .slice(0, index)\r\n .concat(newItems, this.values.slice(index + deleteCount));\r\n return res;\r\n }\r\n };\r\n ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) {\r\n var notifySpy = !this.owned && isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n object: this.proxy,\r\n type: \"update\",\r\n index: index,\r\n newValue: newValue,\r\n oldValue: oldValue\r\n }\r\n : null;\r\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\r\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.atom.name }));\r\n this.atom.reportChanged();\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n };\r\n ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) {\r\n var notifySpy = !this.owned && isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n object: this.proxy,\r\n type: \"splice\",\r\n index: index,\r\n removed: removed,\r\n added: added,\r\n removedCount: removed.length,\r\n addedCount: added.length\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.atom.name }));\r\n this.atom.reportChanged();\r\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n };\r\n return ObservableArrayAdministration;\r\n}());\r\nvar arrayExtensions = {\r\n intercept: function (handler) {\r\n return this[$mobx].intercept(handler);\r\n },\r\n observe: function (listener, fireImmediately) {\r\n if (fireImmediately === void 0) { fireImmediately = false; }\r\n var adm = this[$mobx];\r\n return adm.observe(listener, fireImmediately);\r\n },\r\n clear: function () {\r\n return this.splice(0);\r\n },\r\n replace: function (newItems) {\r\n var adm = this[$mobx];\r\n return adm.spliceWithArray(0, adm.values.length, newItems);\r\n },\r\n /**\r\n * Converts this array back to a (shallow) javascript structure.\r\n * For a deep clone use mobx.toJS\r\n */\r\n toJS: function () {\r\n return this.slice();\r\n },\r\n toJSON: function () {\r\n // Used by JSON.stringify\r\n return this.toJS();\r\n },\r\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\r\n splice: function (index, deleteCount) {\r\n var newItems = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n newItems[_i - 2] = arguments[_i];\r\n }\r\n var adm = this[$mobx];\r\n switch (arguments.length) {\r\n case 0:\r\n return [];\r\n case 1:\r\n return adm.spliceWithArray(index);\r\n case 2:\r\n return adm.spliceWithArray(index, deleteCount);\r\n }\r\n return adm.spliceWithArray(index, deleteCount, newItems);\r\n },\r\n spliceWithArray: function (index, deleteCount, newItems) {\r\n var adm = this[$mobx];\r\n return adm.spliceWithArray(index, deleteCount, newItems);\r\n },\r\n push: function () {\r\n var items = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n items[_i] = arguments[_i];\r\n }\r\n var adm = this[$mobx];\r\n adm.spliceWithArray(adm.values.length, 0, items);\r\n return adm.values.length;\r\n },\r\n pop: function () {\r\n return this.splice(Math.max(this[$mobx].values.length - 1, 0), 1)[0];\r\n },\r\n shift: function () {\r\n return this.splice(0, 1)[0];\r\n },\r\n unshift: function () {\r\n var items = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n items[_i] = arguments[_i];\r\n }\r\n var adm = this[$mobx];\r\n adm.spliceWithArray(0, 0, items);\r\n return adm.values.length;\r\n },\r\n reverse: function () {\r\n // reverse by default mutates in place before returning the result\r\n // which makes it both a 'derivation' and a 'mutation'.\r\n // so we deviate from the default and just make it an dervitation\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.warn(\"[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place\");\r\n }\r\n var clone = this.slice();\r\n return clone.reverse.apply(clone, arguments);\r\n },\r\n sort: function (compareFn) {\r\n // sort by default mutates in place before returning the result\r\n // which goes against all good practices. Let's not change the array in place!\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.warn(\"[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place\");\r\n }\r\n var clone = this.slice();\r\n return clone.sort.apply(clone, arguments);\r\n },\r\n remove: function (value) {\r\n var adm = this[$mobx];\r\n var idx = adm.dehanceValues(adm.values).indexOf(value);\r\n if (idx > -1) {\r\n this.splice(idx, 1);\r\n return true;\r\n }\r\n return false;\r\n },\r\n get: function (index) {\r\n var adm = this[$mobx];\r\n if (adm) {\r\n if (index < adm.values.length) {\r\n adm.atom.reportObserved();\r\n return adm.dehanceValue(adm.values[index]);\r\n }\r\n console.warn(\"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + adm.values.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\");\r\n }\r\n return undefined;\r\n },\r\n set: function (index, newValue) {\r\n var adm = this[$mobx];\r\n var values = adm.values;\r\n if (index < values.length) {\r\n // update at index in range\r\n checkIfStateModificationsAreAllowed(adm.atom);\r\n var oldValue = values[index];\r\n if (hasInterceptors(adm)) {\r\n var change = interceptChange(adm, {\r\n type: \"update\",\r\n object: adm.proxy,\r\n index: index,\r\n newValue: newValue\r\n });\r\n if (!change)\r\n return;\r\n newValue = change.newValue;\r\n }\r\n newValue = adm.enhancer(newValue, oldValue);\r\n var changed = newValue !== oldValue;\r\n if (changed) {\r\n values[index] = newValue;\r\n adm.notifyArrayChildUpdate(index, newValue, oldValue);\r\n }\r\n }\r\n else if (index === values.length) {\r\n // add a new item\r\n adm.spliceWithArray(index, 0, [newValue]);\r\n }\r\n else {\r\n // out of bounds\r\n throw new Error(\"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + values.length);\r\n }\r\n }\r\n};\r\n[\r\n \"concat\",\r\n \"every\",\r\n \"filter\",\r\n \"forEach\",\r\n \"indexOf\",\r\n \"join\",\r\n \"lastIndexOf\",\r\n \"map\",\r\n \"reduce\",\r\n \"reduceRight\",\r\n \"slice\",\r\n \"some\",\r\n \"toString\",\r\n \"toLocaleString\"\r\n].forEach(function (funcName) {\r\n arrayExtensions[funcName] = function () {\r\n var adm = this[$mobx];\r\n adm.atom.reportObserved();\r\n var res = adm.dehanceValues(adm.values);\r\n return res[funcName].apply(res, arguments);\r\n };\r\n});\r\nvar isObservableArrayAdministration = createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\r\nfunction isObservableArray(thing) {\r\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\r\n}\n\nvar _a;\r\nvar ObservableMapMarker = {};\r\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\r\n// But: https://github.com/mobxjs/mobx/issues/1556\r\nvar ObservableMap = /** @class */ (function () {\r\n function ObservableMap(initialData, enhancer, name) {\r\n if (enhancer === void 0) { enhancer = deepEnhancer; }\r\n if (name === void 0) { name = \"ObservableMap@\" + getNextId(); }\r\n this.enhancer = enhancer;\r\n this.name = name;\r\n this[_a] = ObservableMapMarker;\r\n this._keysAtom = createAtom(this.name + \".keys()\");\r\n this[Symbol.toStringTag] = \"Map\";\r\n if (typeof Map !== \"function\") {\r\n throw new Error(\"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\");\r\n }\r\n this._data = new Map();\r\n this._hasMap = new Map();\r\n this.merge(initialData);\r\n }\r\n ObservableMap.prototype._has = function (key) {\r\n return this._data.has(key);\r\n };\r\n ObservableMap.prototype.has = function (key) {\r\n var _this = this;\r\n if (!globalState.trackingDerivation)\r\n return this._has(key);\r\n var entry = this._hasMap.get(key);\r\n if (!entry) {\r\n // todo: replace with atom (breaking change)\r\n var newEntry = (entry = new ObservableValue(this._has(key), referenceEnhancer, this.name + \".\" + stringifyKey(key) + \"?\", false));\r\n this._hasMap.set(key, newEntry);\r\n onBecomeUnobserved(newEntry, function () { return _this._hasMap.delete(key); });\r\n }\r\n return entry.get();\r\n };\r\n ObservableMap.prototype.set = function (key, value) {\r\n var hasKey = this._has(key);\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n type: hasKey ? \"update\" : \"add\",\r\n object: this,\r\n newValue: value,\r\n name: key\r\n });\r\n if (!change)\r\n return this;\r\n value = change.newValue;\r\n }\r\n if (hasKey) {\r\n this._updateValue(key, value);\r\n }\r\n else {\r\n this._addValue(key, value);\r\n }\r\n return this;\r\n };\r\n ObservableMap.prototype.delete = function (key) {\r\n var _this = this;\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n type: \"delete\",\r\n object: this,\r\n name: key\r\n });\r\n if (!change)\r\n return false;\r\n }\r\n if (this._has(key)) {\r\n var notifySpy = isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"delete\",\r\n object: this,\r\n oldValue: this._data.get(key).value,\r\n name: key\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\r\n transaction(function () {\r\n _this._keysAtom.reportChanged();\r\n _this._updateHasMapEntry(key, false);\r\n var observable = _this._data.get(key);\r\n observable.setNewValue(undefined);\r\n _this._data.delete(key);\r\n });\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n return true;\r\n }\r\n return false;\r\n };\r\n ObservableMap.prototype._updateHasMapEntry = function (key, value) {\r\n var entry = this._hasMap.get(key);\r\n if (entry) {\r\n entry.setNewValue(value);\r\n }\r\n };\r\n ObservableMap.prototype._updateValue = function (key, newValue) {\r\n var observable = this._data.get(key);\r\n newValue = observable.prepareNewValue(newValue);\r\n if (newValue !== globalState.UNCHANGED) {\r\n var notifySpy = isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"update\",\r\n object: this,\r\n oldValue: observable.value,\r\n name: key,\r\n newValue: newValue\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\r\n observable.setNewValue(newValue);\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n }\r\n };\r\n ObservableMap.prototype._addValue = function (key, newValue) {\r\n var _this = this;\r\n checkIfStateModificationsAreAllowed(this._keysAtom);\r\n transaction(function () {\r\n var observable = new ObservableValue(newValue, _this.enhancer, _this.name + \".\" + stringifyKey(key), false);\r\n _this._data.set(key, observable);\r\n newValue = observable.value; // value might have been changed\r\n _this._updateHasMapEntry(key, true);\r\n _this._keysAtom.reportChanged();\r\n });\r\n var notifySpy = isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"add\",\r\n object: this,\r\n name: key,\r\n newValue: newValue\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n };\r\n ObservableMap.prototype.get = function (key) {\r\n if (this.has(key))\r\n return this.dehanceValue(this._data.get(key).get());\r\n return this.dehanceValue(undefined);\r\n };\r\n ObservableMap.prototype.dehanceValue = function (value) {\r\n if (this.dehancer !== undefined) {\r\n return this.dehancer(value);\r\n }\r\n return value;\r\n };\r\n ObservableMap.prototype.keys = function () {\r\n this._keysAtom.reportObserved();\r\n return this._data.keys();\r\n };\r\n ObservableMap.prototype.values = function () {\r\n var self = this;\r\n var nextIndex = 0;\r\n var keys = Array.from(this.keys());\r\n return makeIterable({\r\n next: function () {\r\n return nextIndex < keys.length\r\n ? { value: self.get(keys[nextIndex++]), done: false }\r\n : { done: true };\r\n }\r\n });\r\n };\r\n ObservableMap.prototype.entries = function () {\r\n var self = this;\r\n var nextIndex = 0;\r\n var keys = Array.from(this.keys());\r\n return makeIterable({\r\n next: function () {\r\n if (nextIndex < keys.length) {\r\n var key = keys[nextIndex++];\r\n return {\r\n value: [key, self.get(key)],\r\n done: false\r\n };\r\n }\r\n return { done: true };\r\n }\r\n });\r\n };\r\n ObservableMap.prototype[(_a = $mobx, Symbol.iterator)] = function () {\r\n return this.entries();\r\n };\r\n ObservableMap.prototype.forEach = function (callback, thisArg) {\r\n var e_1, _b;\r\n try {\r\n for (var _c = __values(this), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var _e = __read(_d.value, 2), key = _e[0], value = _e[1];\r\n callback.call(thisArg, value, key, this);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n };\r\n /** Merge another object into this object, returns this. */\r\n ObservableMap.prototype.merge = function (other) {\r\n var _this = this;\r\n if (isObservableMap(other)) {\r\n other = other.toJS();\r\n }\r\n transaction(function () {\r\n if (isPlainObject(other))\r\n getPlainObjectKeys(other).forEach(function (key) { return _this.set(key, other[key]); });\r\n else if (Array.isArray(other))\r\n other.forEach(function (_b) {\r\n var _c = __read(_b, 2), key = _c[0], value = _c[1];\r\n return _this.set(key, value);\r\n });\r\n else if (isES6Map(other)) {\r\n if (other.constructor !== Map)\r\n fail(\"Cannot initialize from classes that inherit from Map: \" + other.constructor.name); // prettier-ignore\r\n other.forEach(function (value, key) { return _this.set(key, value); });\r\n }\r\n else if (other !== null && other !== undefined)\r\n fail(\"Cannot initialize map from \" + other);\r\n });\r\n return this;\r\n };\r\n ObservableMap.prototype.clear = function () {\r\n var _this = this;\r\n transaction(function () {\r\n untracked(function () {\r\n var e_2, _b;\r\n try {\r\n for (var _c = __values(_this.keys()), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var key = _d.value;\r\n _this.delete(key);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n });\r\n });\r\n };\r\n ObservableMap.prototype.replace = function (values) {\r\n var _this = this;\r\n transaction(function () {\r\n // grab all the keys that are present in the new map but not present in the current map\r\n // and delete them from the map, then merge the new map\r\n // this will cause reactions only on changed values\r\n var newKeys = getMapLikeKeys(values);\r\n var oldKeys = Array.from(_this.keys());\r\n var missingKeys = oldKeys.filter(function (k) { return newKeys.indexOf(k) === -1; });\r\n missingKeys.forEach(function (k) { return _this.delete(k); });\r\n _this.merge(values);\r\n });\r\n return this;\r\n };\r\n Object.defineProperty(ObservableMap.prototype, \"size\", {\r\n get: function () {\r\n this._keysAtom.reportObserved();\r\n return this._data.size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a plain object that represents this map.\r\n * Note that all the keys being stringified.\r\n * If there are duplicating keys after converting them to strings, behaviour is undetermined.\r\n */\r\n ObservableMap.prototype.toPOJO = function () {\r\n var e_3, _b;\r\n var res = {};\r\n try {\r\n for (var _c = __values(this), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var _e = __read(_d.value, 2), key = _e[0], value = _e[1];\r\n // We lie about symbol key types due to https://github.com/Microsoft/TypeScript/issues/1863\r\n res[typeof key === \"symbol\" ? key : stringifyKey(key)] = value;\r\n }\r\n }\r\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\r\n }\r\n finally { if (e_3) throw e_3.error; }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns a shallow non observable object clone of this map.\r\n * Note that the values migth still be observable. For a deep clone use mobx.toJS.\r\n */\r\n ObservableMap.prototype.toJS = function () {\r\n return new Map(this);\r\n };\r\n ObservableMap.prototype.toJSON = function () {\r\n // Used by JSON.stringify\r\n return this.toPOJO();\r\n };\r\n ObservableMap.prototype.toString = function () {\r\n var _this = this;\r\n return (this.name +\r\n \"[{ \" +\r\n Array.from(this.keys())\r\n .map(function (key) { return stringifyKey(key) + \": \" + (\"\" + _this.get(key)); })\r\n .join(\", \") +\r\n \" }]\");\r\n };\r\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\r\n ObservableMap.prototype.observe = function (listener, fireImmediately) {\r\n process.env.NODE_ENV !== \"production\" &&\r\n invariant(fireImmediately !== true, \"`observe` doesn't support fireImmediately=true in combination with maps.\");\r\n return registerListener(this, listener);\r\n };\r\n ObservableMap.prototype.intercept = function (handler) {\r\n return registerInterceptor(this, handler);\r\n };\r\n return ObservableMap;\r\n}());\r\n/* 'var' fixes small-build issue */\r\nvar isObservableMap = createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nvar _a$1;\r\nvar ObservableSetMarker = {};\r\nvar ObservableSet = /** @class */ (function () {\r\n function ObservableSet(initialData, enhancer, name) {\r\n if (enhancer === void 0) { enhancer = deepEnhancer; }\r\n if (name === void 0) { name = \"ObservableSet@\" + getNextId(); }\r\n this.name = name;\r\n this[_a$1] = ObservableSetMarker;\r\n this._data = new Set();\r\n this._atom = createAtom(this.name);\r\n this[Symbol.toStringTag] = \"Set\";\r\n if (typeof Set !== \"function\") {\r\n throw new Error(\"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\");\r\n }\r\n this.enhancer = function (newV, oldV) { return enhancer(newV, oldV, name); };\r\n if (initialData) {\r\n this.replace(initialData);\r\n }\r\n }\r\n ObservableSet.prototype.dehanceValue = function (value) {\r\n if (this.dehancer !== undefined) {\r\n return this.dehancer(value);\r\n }\r\n return value;\r\n };\r\n ObservableSet.prototype.clear = function () {\r\n var _this = this;\r\n transaction(function () {\r\n untracked(function () {\r\n var e_1, _b;\r\n try {\r\n for (var _c = __values(_this._data.values()), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var value = _d.value;\r\n _this.delete(value);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n });\r\n });\r\n };\r\n ObservableSet.prototype.forEach = function (callbackFn, thisArg) {\r\n var e_2, _b;\r\n try {\r\n for (var _c = __values(this), _d = _c.next(); !_d.done; _d = _c.next()) {\r\n var value = _d.value;\r\n callbackFn.call(thisArg, value, value, this);\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n };\r\n Object.defineProperty(ObservableSet.prototype, \"size\", {\r\n get: function () {\r\n this._atom.reportObserved();\r\n return this._data.size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ObservableSet.prototype.add = function (value) {\r\n var _this = this;\r\n checkIfStateModificationsAreAllowed(this._atom);\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n type: \"add\",\r\n object: this,\r\n newValue: value\r\n });\r\n if (!change)\r\n return this;\r\n // TODO: ideally, value = change.value would be done here, so that values can be\r\n // changed by interceptor. Same applies for other Set and Map api's.\r\n }\r\n if (!this.has(value)) {\r\n transaction(function () {\r\n _this._data.add(_this.enhancer(value, undefined));\r\n _this._atom.reportChanged();\r\n });\r\n var notifySpy = isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"add\",\r\n object: this,\r\n newValue: value\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(change);\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n }\r\n return this;\r\n };\r\n ObservableSet.prototype.delete = function (value) {\r\n var _this = this;\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n type: \"delete\",\r\n object: this,\r\n oldValue: value\r\n });\r\n if (!change)\r\n return false;\r\n }\r\n if (this.has(value)) {\r\n var notifySpy = isSpyEnabled();\r\n var notify = hasListeners(this);\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"delete\",\r\n object: this,\r\n oldValue: value\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name }));\r\n transaction(function () {\r\n _this._atom.reportChanged();\r\n _this._data.delete(value);\r\n });\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n return true;\r\n }\r\n return false;\r\n };\r\n ObservableSet.prototype.has = function (value) {\r\n this._atom.reportObserved();\r\n return this._data.has(this.dehanceValue(value));\r\n };\r\n ObservableSet.prototype.entries = function () {\r\n var nextIndex = 0;\r\n var keys = Array.from(this.keys());\r\n var values = Array.from(this.values());\r\n return makeIterable({\r\n next: function () {\r\n var index = nextIndex;\r\n nextIndex += 1;\r\n return index < values.length\r\n ? { value: [keys[index], values[index]], done: false }\r\n : { done: true };\r\n }\r\n });\r\n };\r\n ObservableSet.prototype.keys = function () {\r\n return this.values();\r\n };\r\n ObservableSet.prototype.values = function () {\r\n this._atom.reportObserved();\r\n var self = this;\r\n var nextIndex = 0;\r\n var observableValues = Array.from(this._data.values());\r\n return makeIterable({\r\n next: function () {\r\n return nextIndex < observableValues.length\r\n ? { value: self.dehanceValue(observableValues[nextIndex++]), done: false }\r\n : { done: true };\r\n }\r\n });\r\n };\r\n ObservableSet.prototype.replace = function (other) {\r\n var _this = this;\r\n if (isObservableSet(other)) {\r\n other = other.toJS();\r\n }\r\n transaction(function () {\r\n if (Array.isArray(other)) {\r\n _this.clear();\r\n other.forEach(function (value) { return _this.add(value); });\r\n }\r\n else if (isES6Set(other)) {\r\n _this.clear();\r\n other.forEach(function (value) { return _this.add(value); });\r\n }\r\n else if (other !== null && other !== undefined) {\r\n fail(\"Cannot initialize set from \" + other);\r\n }\r\n });\r\n return this;\r\n };\r\n ObservableSet.prototype.observe = function (listener, fireImmediately) {\r\n // TODO 'fireImmediately' can be true?\r\n process.env.NODE_ENV !== \"production\" &&\r\n invariant(fireImmediately !== true, \"`observe` doesn't support fireImmediately=true in combination with sets.\");\r\n return registerListener(this, listener);\r\n };\r\n ObservableSet.prototype.intercept = function (handler) {\r\n return registerInterceptor(this, handler);\r\n };\r\n ObservableSet.prototype.toJS = function () {\r\n return new Set(this);\r\n };\r\n ObservableSet.prototype.toString = function () {\r\n return this.name + \"[ \" + Array.from(this).join(\", \") + \" ]\";\r\n };\r\n ObservableSet.prototype[(_a$1 = $mobx, Symbol.iterator)] = function () {\r\n return this.values();\r\n };\r\n return ObservableSet;\r\n}());\r\nvar isObservableSet = createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar ObservableObjectAdministration = /** @class */ (function () {\r\n function ObservableObjectAdministration(target, values, name, defaultEnhancer) {\r\n if (values === void 0) { values = new Map(); }\r\n this.target = target;\r\n this.values = values;\r\n this.name = name;\r\n this.defaultEnhancer = defaultEnhancer;\r\n this.keysAtom = new Atom(name + \".keys\");\r\n }\r\n ObservableObjectAdministration.prototype.read = function (key) {\r\n return this.values.get(key).get();\r\n };\r\n ObservableObjectAdministration.prototype.write = function (key, newValue) {\r\n var instance = this.target;\r\n var observable = this.values.get(key);\r\n if (observable instanceof ComputedValue) {\r\n observable.set(newValue);\r\n return;\r\n }\r\n // intercept\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n type: \"update\",\r\n object: this.proxy || instance,\r\n name: key,\r\n newValue: newValue\r\n });\r\n if (!change)\r\n return;\r\n newValue = change.newValue;\r\n }\r\n newValue = observable.prepareNewValue(newValue);\r\n // notify spy & observers\r\n if (newValue !== globalState.UNCHANGED) {\r\n var notify = hasListeners(this);\r\n var notifySpy = isSpyEnabled();\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"update\",\r\n object: this.proxy || instance,\r\n oldValue: observable.value,\r\n name: key,\r\n newValue: newValue\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\r\n observable.setNewValue(newValue);\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n }\r\n };\r\n ObservableObjectAdministration.prototype.has = function (key) {\r\n var map = this.pendingKeys || (this.pendingKeys = new Map());\r\n var entry = map.get(key);\r\n if (entry)\r\n return entry.get();\r\n else {\r\n var exists = !!this.values.get(key);\r\n // Possible optimization: Don't have a separate map for non existing keys,\r\n // but store them in the values map instead, using a special symbol to denote \"not existing\"\r\n entry = new ObservableValue(exists, referenceEnhancer, this.name + \".\" + stringifyKey(key) + \"?\", false);\r\n map.set(key, entry);\r\n return entry.get(); // read to subscribe\r\n }\r\n };\r\n ObservableObjectAdministration.prototype.addObservableProp = function (propName, newValue, enhancer) {\r\n if (enhancer === void 0) { enhancer = this.defaultEnhancer; }\r\n var target = this.target;\r\n assertPropertyConfigurable(target, propName);\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n object: this.proxy || target,\r\n name: propName,\r\n type: \"add\",\r\n newValue: newValue\r\n });\r\n if (!change)\r\n return;\r\n newValue = change.newValue;\r\n }\r\n var observable = new ObservableValue(newValue, enhancer, this.name + \".\" + stringifyKey(propName), false);\r\n this.values.set(propName, observable);\r\n newValue = observable.value; // observableValue might have changed it\r\n Object.defineProperty(target, propName, generateObservablePropConfig(propName));\r\n this.notifyPropertyAddition(propName, newValue);\r\n };\r\n ObservableObjectAdministration.prototype.addComputedProp = function (propertyOwner, // where is the property declared?\r\n propName, options) {\r\n var target = this.target;\r\n options.name = options.name || this.name + \".\" + stringifyKey(propName);\r\n this.values.set(propName, new ComputedValue(options));\r\n if (propertyOwner === target || isPropertyConfigurable(propertyOwner, propName))\r\n Object.defineProperty(propertyOwner, propName, generateComputedPropConfig(propName));\r\n };\r\n ObservableObjectAdministration.prototype.remove = function (key) {\r\n if (!this.values.has(key))\r\n return;\r\n var target = this.target;\r\n if (hasInterceptors(this)) {\r\n var change = interceptChange(this, {\r\n object: this.proxy || target,\r\n name: key,\r\n type: \"remove\"\r\n });\r\n if (!change)\r\n return;\r\n }\r\n try {\r\n startBatch();\r\n var notify = hasListeners(this);\r\n var notifySpy = isSpyEnabled();\r\n var oldObservable = this.values.get(key);\r\n var oldValue = oldObservable && oldObservable.get();\r\n oldObservable && oldObservable.set(undefined);\r\n // notify key and keyset listeners\r\n this.keysAtom.reportChanged();\r\n this.values.delete(key);\r\n if (this.pendingKeys) {\r\n var entry = this.pendingKeys.get(key);\r\n if (entry)\r\n entry.set(false);\r\n }\r\n // delete the prop\r\n delete this.target[key];\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"remove\",\r\n object: this.proxy || target,\r\n oldValue: oldValue,\r\n name: key\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n }\r\n finally {\r\n endBatch();\r\n }\r\n };\r\n ObservableObjectAdministration.prototype.illegalAccess = function (owner, propName) {\r\n /**\r\n * This happens if a property is accessed through the prototype chain, but the property was\r\n * declared directly as own property on the prototype.\r\n *\r\n * E.g.:\r\n * class A {\r\n * }\r\n * extendObservable(A.prototype, { x: 1 })\r\n *\r\n * classB extens A {\r\n * }\r\n * console.log(new B().x)\r\n *\r\n * It is unclear whether the property should be considered 'static' or inherited.\r\n * Either use `console.log(A.x)`\r\n * or: decorate(A, { x: observable })\r\n *\r\n * When using decorate, the property will always be redeclared as own property on the actual instance\r\n */\r\n console.warn(\"Property '\" + propName + \"' of '\" + owner + \"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner\");\r\n };\r\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\r\n ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) {\r\n process.env.NODE_ENV !== \"production\" &&\r\n invariant(fireImmediately !== true, \"`observe` doesn't support the fire immediately property for observable objects.\");\r\n return registerListener(this, callback);\r\n };\r\n ObservableObjectAdministration.prototype.intercept = function (handler) {\r\n return registerInterceptor(this, handler);\r\n };\r\n ObservableObjectAdministration.prototype.notifyPropertyAddition = function (key, newValue) {\r\n var notify = hasListeners(this);\r\n var notifySpy = isSpyEnabled();\r\n var change = notify || notifySpy\r\n ? {\r\n type: \"add\",\r\n object: this.proxy || this.target,\r\n name: key,\r\n newValue: newValue\r\n }\r\n : null;\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\r\n if (notify)\r\n notifyListeners(this, change);\r\n if (notifySpy && process.env.NODE_ENV !== \"production\")\r\n spyReportEnd();\r\n if (this.pendingKeys) {\r\n var entry = this.pendingKeys.get(key);\r\n if (entry)\r\n entry.set(true);\r\n }\r\n this.keysAtom.reportChanged();\r\n };\r\n ObservableObjectAdministration.prototype.getKeys = function () {\r\n var e_1, _a;\r\n this.keysAtom.reportObserved();\r\n // return Reflect.ownKeys(this.values) as any\r\n var res = [];\r\n try {\r\n for (var _b = __values(this.values), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var _d = __read(_c.value, 2), key = _d[0], value = _d[1];\r\n if (value instanceof ObservableValue)\r\n res.push(key);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return res;\r\n };\r\n return ObservableObjectAdministration;\r\n}());\r\nfunction asObservableObject(target, name, defaultEnhancer) {\r\n if (name === void 0) { name = \"\"; }\r\n if (defaultEnhancer === void 0) { defaultEnhancer = deepEnhancer; }\r\n if (Object.prototype.hasOwnProperty.call(target, $mobx))\r\n return target[$mobx];\r\n process.env.NODE_ENV !== \"production\" &&\r\n invariant(Object.isExtensible(target), \"Cannot make the designated object observable; it is not extensible\");\r\n if (!isPlainObject(target))\r\n name = (target.constructor.name || \"ObservableObject\") + \"@\" + getNextId();\r\n if (!name)\r\n name = \"ObservableObject@\" + getNextId();\r\n var adm = new ObservableObjectAdministration(target, new Map(), stringifyKey(name), defaultEnhancer);\r\n addHiddenProp(target, $mobx, adm);\r\n return adm;\r\n}\r\nvar observablePropertyConfigs = Object.create(null);\r\nvar computedPropertyConfigs = Object.create(null);\r\nfunction generateObservablePropConfig(propName) {\r\n return (observablePropertyConfigs[propName] ||\r\n (observablePropertyConfigs[propName] = {\r\n configurable: true,\r\n enumerable: true,\r\n get: function () {\r\n return this[$mobx].read(propName);\r\n },\r\n set: function (v) {\r\n this[$mobx].write(propName, v);\r\n }\r\n }));\r\n}\r\nfunction getAdministrationForComputedPropOwner(owner) {\r\n var adm = owner[$mobx];\r\n if (!adm) {\r\n // because computed props are declared on proty,\r\n // the current instance might not have been initialized yet\r\n initializeInstance(owner);\r\n return owner[$mobx];\r\n }\r\n return adm;\r\n}\r\nfunction generateComputedPropConfig(propName) {\r\n return (computedPropertyConfigs[propName] ||\r\n (computedPropertyConfigs[propName] = {\r\n configurable: globalState.computedConfigurable,\r\n enumerable: false,\r\n get: function () {\r\n return getAdministrationForComputedPropOwner(this).read(propName);\r\n },\r\n set: function (v) {\r\n getAdministrationForComputedPropOwner(this).write(propName, v);\r\n }\r\n }));\r\n}\r\nvar isObservableObjectAdministration = createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\r\nfunction isObservableObject(thing) {\r\n if (isObject(thing)) {\r\n // Initializers run lazily when transpiling to babel, so make sure they are run...\r\n initializeInstance(thing);\r\n return isObservableObjectAdministration(thing[$mobx]);\r\n }\r\n return false;\r\n}\n\nfunction getAtom(thing, property) {\r\n if (typeof thing === \"object\" && thing !== null) {\r\n if (isObservableArray(thing)) {\r\n if (property !== undefined)\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n \"It is not possible to get index atoms from arrays\");\r\n return thing[$mobx].atom;\r\n }\r\n if (isObservableSet(thing)) {\r\n return thing[$mobx];\r\n }\r\n if (isObservableMap(thing)) {\r\n var anyThing = thing;\r\n if (property === undefined)\r\n return anyThing._keysAtom;\r\n var observable = anyThing._data.get(property) || anyThing._hasMap.get(property);\r\n if (!observable)\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n \"the entry '\" + property + \"' does not exist in the observable map '\" + getDebugName(thing) + \"'\");\r\n return observable;\r\n }\r\n // Initializers run lazily when transpiling to babel, so make sure they are run...\r\n initializeInstance(thing);\r\n if (property && !thing[$mobx])\r\n thing[property]; // See #1072\r\n if (isObservableObject(thing)) {\r\n if (!property)\r\n return fail(process.env.NODE_ENV !== \"production\" && \"please specify a property\");\r\n var observable = thing[$mobx].values.get(property);\r\n if (!observable)\r\n fail(process.env.NODE_ENV !== \"production\" &&\r\n \"no observable property '\" + property + \"' found on the observable object '\" + getDebugName(thing) + \"'\");\r\n return observable;\r\n }\r\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\r\n return thing;\r\n }\r\n }\r\n else if (typeof thing === \"function\") {\r\n if (isReaction(thing[$mobx])) {\r\n // disposer function\r\n return thing[$mobx];\r\n }\r\n }\r\n return fail(process.env.NODE_ENV !== \"production\" && \"Cannot obtain atom from \" + thing);\r\n}\r\nfunction getAdministration(thing, property) {\r\n if (!thing)\r\n fail(\"Expecting some object\");\r\n if (property !== undefined)\r\n return getAdministration(getAtom(thing, property));\r\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing))\r\n return thing;\r\n if (isObservableMap(thing) || isObservableSet(thing))\r\n return thing;\r\n // Initializers run lazily when transpiling to babel, so make sure they are run...\r\n initializeInstance(thing);\r\n if (thing[$mobx])\r\n return thing[$mobx];\r\n fail(process.env.NODE_ENV !== \"production\" && \"Cannot obtain administration from \" + thing);\r\n}\r\nfunction getDebugName(thing, property) {\r\n var named;\r\n if (property !== undefined)\r\n named = getAtom(thing, property);\r\n else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing))\r\n named = getAdministration(thing);\r\n else\r\n named = getAtom(thing); // valid for arrays as well\r\n return named.name;\r\n}\n\nvar toString = Object.prototype.toString;\r\nfunction deepEqual(a, b, depth) {\r\n if (depth === void 0) { depth = -1; }\r\n return eq(a, b, depth);\r\n}\r\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\r\n// Internal recursive comparison function for `isEqual`.\r\nfunction eq(a, b, depth, aStack, bStack) {\r\n // Identical objects are equal. `0 === -0`, but they aren't identical.\r\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\r\n if (a === b)\r\n return a !== 0 || 1 / a === 1 / b;\r\n // `null` or `undefined` only equal to itself (strict comparison).\r\n if (a == null || b == null)\r\n return false;\r\n // `NaN`s are equivalent, but non-reflexive.\r\n if (a !== a)\r\n return b !== b;\r\n // Exhaust primitive checks\r\n var type = typeof a;\r\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\")\r\n return false;\r\n // Compare `[[Class]]` names.\r\n var className = toString.call(a);\r\n if (className !== toString.call(b))\r\n return false;\r\n switch (className) {\r\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\r\n case \"[object RegExp]\":\r\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\r\n case \"[object String]\":\r\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\r\n // equivalent to `new String(\"5\")`.\r\n return \"\" + a === \"\" + b;\r\n case \"[object Number]\":\r\n // `NaN`s are equivalent, but non-reflexive.\r\n // Object(NaN) is equivalent to NaN.\r\n if (+a !== +a)\r\n return +b !== +b;\r\n // An `egal` comparison is performed for other numeric values.\r\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\r\n case \"[object Date]\":\r\n case \"[object Boolean]\":\r\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\r\n // millisecond representations. Note that invalid dates with millisecond representations\r\n // of `NaN` are not equivalent.\r\n return +a === +b;\r\n case \"[object Symbol]\":\r\n return (typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b));\r\n case \"[object Map]\":\r\n case \"[object Set]\":\r\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\r\n // Hide this extra level by increasing the depth.\r\n if (depth >= 0) {\r\n depth++;\r\n }\r\n break;\r\n }\r\n // Unwrap any wrapped objects.\r\n a = unwrap(a);\r\n b = unwrap(b);\r\n var areArrays = className === \"[object Array]\";\r\n if (!areArrays) {\r\n if (typeof a != \"object\" || typeof b != \"object\")\r\n return false;\r\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\r\n // from different frames are.\r\n var aCtor = a.constructor, bCtor = b.constructor;\r\n if (aCtor !== bCtor &&\r\n !(typeof aCtor === \"function\" &&\r\n aCtor instanceof aCtor &&\r\n typeof bCtor === \"function\" &&\r\n bCtor instanceof bCtor) &&\r\n (\"constructor\" in a && \"constructor\" in b)) {\r\n return false;\r\n }\r\n }\r\n if (depth === 0) {\r\n return false;\r\n }\r\n else if (depth < 0) {\r\n depth = -1;\r\n }\r\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\r\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\r\n // Initializing stack of traversed objects.\r\n // It's done here since we only need them for objects and arrays comparison.\r\n aStack = aStack || [];\r\n bStack = bStack || [];\r\n var length = aStack.length;\r\n while (length--) {\r\n // Linear search. Performance is inversely proportional to the number of\r\n // unique nested structures.\r\n if (aStack[length] === a)\r\n return bStack[length] === b;\r\n }\r\n // Add the first object to the stack of traversed objects.\r\n aStack.push(a);\r\n bStack.push(b);\r\n // Recursively compare objects and arrays.\r\n if (areArrays) {\r\n // Compare array lengths to determine if a deep comparison is necessary.\r\n length = a.length;\r\n if (length !== b.length)\r\n return false;\r\n // Deep compare the contents, ignoring non-numeric properties.\r\n while (length--) {\r\n if (!eq(a[length], b[length], depth - 1, aStack, bStack))\r\n return false;\r\n }\r\n }\r\n else {\r\n // Deep compare objects.\r\n var keys = Object.keys(a);\r\n var key = void 0;\r\n length = keys.length;\r\n // Ensure that both objects contain the same number of properties before comparing deep equality.\r\n if (Object.keys(b).length !== length)\r\n return false;\r\n while (length--) {\r\n // Deep compare each member\r\n key = keys[length];\r\n if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))\r\n return false;\r\n }\r\n }\r\n // Remove the first object from the stack of traversed objects.\r\n aStack.pop();\r\n bStack.pop();\r\n return true;\r\n}\r\nfunction unwrap(a) {\r\n if (isObservableArray(a))\r\n return a.slice();\r\n if (isES6Map(a) || isObservableMap(a))\r\n return Array.from(a.entries());\r\n if (isES6Set(a) || isObservableSet(a))\r\n return Array.from(a.entries());\r\n return a;\r\n}\r\nfunction has$1(a, key) {\r\n return Object.prototype.hasOwnProperty.call(a, key);\r\n}\n\nfunction makeIterable(iterator) {\r\n iterator[Symbol.iterator] = getSelf;\r\n return iterator;\r\n}\r\nfunction getSelf() {\r\n return this;\r\n}\n\n/*\r\nThe only reason for this file to exist is pure horror:\r\nWithout it rollup can make the bundling fail at any point in time; when it rolls up the files in the wrong order\r\nit will cause undefined errors (for example because super classes or local variables not being hoisted).\r\nWith this file that will still happen,\r\nbut at least in this file we can magically reorder the imports with trial and error until the build succeeds again.\r\n*/\n\n/**\r\n * (c) Michel Weststrate 2015 - 2018\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get an global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\r\nif (typeof Proxy === \"undefined\" || typeof Symbol === \"undefined\") {\r\n throw new Error(\"[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.\");\r\n}\r\ntry {\r\n // define process.env if needed\r\n // if this is not a production build in the first place\r\n // (in which case the expression below would be substituted with 'production')\r\n process.env.NODE_ENV;\r\n}\r\ncatch (e) {\r\n var g = getGlobal();\r\n if (typeof process === \"undefined\")\r\n g.process = {};\r\n g.process.env = {};\r\n}\r\n(function () {\r\n function testCodeMinification() { }\r\n if (testCodeMinification.name !== \"testCodeMinification\" &&\r\n process.env.NODE_ENV !== \"production\" &&\r\n typeof process !== 'undefined' && process.env.IGNORE_MOBX_MINIFY_WARNING !== \"true\") {\r\n // trick so it doesn't get replaced\r\n var varName = [\"process\", \"env\", \"NODE_ENV\"].join(\".\");\r\n console.warn(\"[mobx] you are running a minified build, but '\" + varName + \"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle\");\r\n }\r\n})();\r\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\r\n // See: https://github.com/andykog/mobx-devtools/\r\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\r\n spy: spy,\r\n extras: {\r\n getDebugName: getDebugName\r\n },\r\n $mobx: $mobx\r\n });\r\n}\n\nexport { $mobx, FlowCancellationError, IDerivationState, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, allowStateChangesInsideComputed as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, decorate, entries, extendObservable, flow, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isArrayLike, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n","import { Component, h } from 'preact';\nimport { createAtom, Reaction, _getGlobalState } from 'mobx';\n\nfunction isStateless(component) {\n // `function() {}` has prototype, but `() => {}` doesn't\n // `() => {}` via Babel has prototype too.\n return !(component.prototype && component.prototype.render) && !Component.isPrototypeOf(component);\n}\n\nfunction makeDisplayName(component) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$prefix = _ref.prefix,\n prefix = _ref$prefix === undefined ? '' : _ref$prefix,\n _ref$suffix = _ref.suffix,\n suffix = _ref$suffix === undefined ? '' : _ref$suffix;\n\n var displayName = component.displayName || component.name || component.constructor && component.constructor.name || '';\n return prefix + displayName + suffix;\n}\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar isUsingStaticRendering = false;\n\nvar logger = console; // eslint-disable-line no-console\n\nfunction useStaticRendering(useStaticRendering) {\n isUsingStaticRendering = useStaticRendering;\n}\n\n/**\n Workaround\n\n allowStateChanges from mobX must be patched so that props, state and args are passed to the render() function\n */\n\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = _getGlobalState().allowStateChanges;\n _getGlobalState().allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n _getGlobalState().allowStateChanges = prev;\n}\n\nfunction allowStateChanges(allowStateChanges, func, props, state, context) {\n var prev = allowStateChangesStart(allowStateChanges);\n var res = void 0;\n try {\n res = func(props, state, context);\n } finally {\n allowStateChangesEnd(prev);\n }\n return res;\n}\n\n/**\n * Utilities\n */\n\nfunction patch(target, funcName) {\n var runMixinFirst = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var base = target[funcName];\n var mixinFunc = reactiveMixin[funcName];\n var f = !base ? mixinFunc : runMixinFirst === true ? function () {\n mixinFunc.apply(this, arguments);\n base.apply(this, arguments);\n } : function () {\n base.apply(this, arguments);\n mixinFunc.apply(this, arguments);\n };\n\n // MWE: ideally we freeze here to protect against accidental overwrites in component instances, see #195\n // ...but that breaks react-hot-loader, see #231...\n target[funcName] = f;\n}\n\nfunction isObjectShallowModified(prev, next) {\n if (null == prev || null == next || (typeof prev === 'undefined' ? 'undefined' : _typeof(prev)) !== 'object' || (typeof next === 'undefined' ? 'undefined' : _typeof(next)) !== 'object') {\n return prev !== next;\n }\n var keys = Object.keys(prev);\n if (keys.length !== Object.keys(next).length) {\n return true;\n }\n var key = void 0;\n for (var i = keys.length - 1; key = keys[i]; i--) {\n if (next[key] !== prev[key]) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * ReactiveMixin\n */\nvar reactiveMixin = {\n componentWillMount: function componentWillMount() {\n var _this = this;\n\n if (isUsingStaticRendering === true) {\n return;\n }\n // Generate friendly name for debugging\n var initialName = makeDisplayName(this);\n\n /**\n * If props are shallowly modified, react will render anyway,\n * so atom.reportChanged() should not result in yet another re-render\n */\n var skipRender = false;\n /**\n * forceUpdate will re-assign this.props. We don't want that to cause a loop,\n * so detect these changes\n */\n var isForcingUpdate = false;\n\n function makePropertyObservableReference(propName) {\n var valueHolder = this[propName];\n var atom = createAtom('reactive ' + propName);\n Object.defineProperty(this, propName, {\n configurable: true,\n enumerable: true,\n get: function get$$1() {\n atom.reportObserved();\n return valueHolder;\n },\n set: function set$$1(v) {\n if (!isForcingUpdate && isObjectShallowModified(valueHolder, v)) {\n valueHolder = v;\n skipRender = true;\n atom.reportChanged();\n skipRender = false;\n } else {\n valueHolder = v;\n }\n }\n });\n }\n\n // make this.props an observable reference, see #124\n makePropertyObservableReference.call(this, 'props');\n // make state an observable reference\n makePropertyObservableReference.call(this, 'state');\n\n // wire up reactive render\n var baseRender = this.render.bind(this);\n var reaction = null;\n var isRenderingPending = false;\n\n var initialRender = function initialRender() {\n reaction = new Reaction(initialName + '.render()', function () {\n if (!isRenderingPending) {\n // N.B. Getting here *before mounting* means that a component constructor has side effects (see the relevant test in misc.js)\n // This unidiomatic React usage but React will correctly warn about this so we continue as usual\n // See #85 / Pull #44\n isRenderingPending = true;\n if (typeof _this.componentWillReact === 'function') {\n _this.componentWillReact();\n } // TODO: wrap in action?\n if (_this.__$mobxIsUnmounted !== true) {\n // If we are unmounted at this point, componentWillReact() had a side effect causing the component to unmounted\n // TODO: remove this check? Then react will properly warn about the fact that this should not happen? See #73\n // However, people also claim this migth happen during unit tests..\n var hasError = true;\n try {\n isForcingUpdate = true;\n if (!skipRender) {\n Component.prototype.forceUpdate.call(_this);\n }\n hasError = false;\n } finally {\n isForcingUpdate = false;\n if (hasError) {\n reaction.dispose();\n }\n }\n }\n }\n });\n reaction.reactComponent = _this;\n reactiveRender.$mobx = reaction;\n _this.render = reactiveRender;\n return reactiveRender(_this.props, _this.state, _this.context);\n };\n\n var reactiveRender = function reactiveRender(props, state, context) {\n isRenderingPending = false;\n var exception = undefined;\n var rendering = undefined;\n reaction.track(function () {\n try {\n rendering = allowStateChanges(false, baseRender, props, state, context);\n } catch (e) {\n exception = e;\n }\n });\n if (exception) {\n throw exception;\n }\n return rendering;\n };\n\n this.render = initialRender;\n },\n\n componentWillUnmount: function componentWillUnmount() {\n if (isUsingStaticRendering === true) {\n return;\n }\n this.render.$mobx && this.render.$mobx.dispose();\n this.__$mobxIsUnmounted = true;\n },\n\n componentDidMount: function componentDidMount() {},\n\n componentDidUpdate: function componentDidUpdate() {},\n\n shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) {\n if (isUsingStaticRendering) {\n logger.warn('[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side.');\n }\n // update on any state changes (as is the default)\n if (this.state !== nextState) {\n return true;\n }\n // update if props are shallowly not equal, inspired by PureRenderMixin\n // we could return just 'false' here, and avoid the `skipRender` checks etc\n // however, it is nicer if lifecycle events are triggered like usually,\n // so we return true here if props are shallowly modified.\n return isObjectShallowModified(this.props, nextProps);\n }\n};\n\n/**\n * Observer function / decorator\n */\nfunction observer(componentClass) {\n if (arguments.length > 1) {\n logger.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect([\"store1\", \"store2\"]) ComponentClass instead or preferably, use `@inject(\"store1\", \"store2\") @observer ComponentClass` or `inject(\"store1\", \"store2\")(observer(componentClass))``');\n }\n\n if (componentClass.isMobxInjector === true) {\n logger.warn('Mobx observer: You are trying to use \\'observer\\' on a component that already has \\'inject\\'. Please apply \\'observer\\' before applying \\'inject\\'');\n }\n\n // Stateless function component:\n if (isStateless(componentClass)) {\n var _class, _temp;\n\n return observer((_temp = _class = function (_Component) {\n inherits(_class, _Component);\n\n function _class() {\n classCallCheck(this, _class);\n return possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));\n }\n\n createClass(_class, [{\n key: 'render',\n value: function render() {\n return componentClass.call(this, this.props, this.context);\n }\n }]);\n return _class;\n }(Component), _class.displayName = makeDisplayName(componentClass), _temp));\n }\n\n if (!componentClass) {\n throw new Error('Please pass a valid component to \\'observer\\'');\n }\n\n var target = componentClass.prototype || componentClass;\n mixinLifecycleEvents(target);\n componentClass.isMobXReactObserver = true;\n return componentClass;\n}\n\nfunction mixinLifecycleEvents(target) {\n patch(target, 'componentWillMount', true);\n patch(target, 'componentDidMount');\n\n if (!target.shouldComponentUpdate) {\n target.shouldComponentUpdate = reactiveMixin.shouldComponentUpdate;\n }\n}\n\nvar Observer = observer(function (_ref) {\n var children = _ref.children;\n return children[0]();\n});\n\nObserver.displayName = 'Observer';\n\nvar commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar hoistNonReactStatics = createCommonjsModule(function (module, exports) {\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n(function (global, factory) {\n module.exports = factory();\n}(commonjsGlobal, (function () {\n \n var REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n };\n \n var KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n };\n \n var defineProperty = Object.defineProperty;\n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertySymbols = Object.getOwnPropertySymbols;\n var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var getPrototypeOf = Object.getPrototypeOf;\n var objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n \n return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n \n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n \n var keys = getOwnPropertyNames(sourceComponent);\n \n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n \n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try { // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n \n return targetComponent;\n }\n \n return targetComponent;\n };\n})));\n});\n\nvar proxiedInjectorProps = {\n isMobxInjector: {\n value: true,\n writable: true,\n configurable: true,\n enumerable: true\n }\n};\n\n/**\n * Store Injection\n */\nfunction createStoreInjector(grabStoresFn, component, injectNames) {\n var _class, _temp;\n\n var prefix = 'inject-';\n var suffix = injectNames ? '-with-' + injectNames : '';\n var displayName = makeDisplayName(component, { prefix: prefix, suffix: suffix });\n\n var Injector = (_temp = _class = function (_Component) {\n inherits(Injector, _Component);\n\n function Injector() {\n classCallCheck(this, Injector);\n return possibleConstructorReturn(this, (Injector.__proto__ || Object.getPrototypeOf(Injector)).apply(this, arguments));\n }\n\n createClass(Injector, [{\n key: 'render',\n value: function render() {\n // Optimization: it might be more efficient to apply the mapper function *outside* the render method\n // (if the mapper is a function), that could avoid expensive(?) re-rendering of the injector component\n // See this test: 'using a custom injector is not too reactive' in inject.js\n var newProps = {};\n for (var key in this.props) {\n if (this.props.hasOwnProperty(key)) {\n newProps[key] = this.props[key];\n }\n }\n var additionalProps = grabStoresFn(this.context.mobxStores || {}, newProps, this.context) || {};\n for (var _key in additionalProps) {\n newProps[_key] = additionalProps[_key];\n }\n\n return h(component, newProps);\n }\n }]);\n return Injector;\n }(Component), _class.displayName = displayName, _temp);\n\n // Static fields from component should be visible on the generated Injector\n\n hoistNonReactStatics(Injector, component);\n\n Injector.wrappedComponent = component;\n Object.defineProperties(Injector, proxiedInjectorProps);\n\n return Injector;\n}\n\nfunction grabStoresByName(storeNames) {\n return function (baseStores, nextProps) {\n storeNames.forEach(function (storeName) {\n // prefer props over stores\n if (storeName in nextProps) {\n return;\n }\n if (!(storeName in baseStores)) {\n throw new Error('MobX injector: Store \\'' + storeName + '\\' is not available! Make sure it is provided by some Provider');\n }\n nextProps[storeName] = baseStores[storeName];\n });\n return nextProps;\n };\n}\n\n/**\n * higher order component that injects stores to a child.\n * takes either a varargs list of strings, which are stores read from the context,\n * or a function that manually maps the available stores from the context to props:\n * storesToProps(mobxStores, props, context) => newProps\n */\nfunction inject() /* fn(stores, nextProps) or ...storeNames */{\n var grabStoresFn = void 0;\n if (typeof arguments[0] === 'function') {\n grabStoresFn = arguments[0];\n return function (componentClass) {\n var injected = createStoreInjector(grabStoresFn, componentClass);\n injected.isMobxInjector = false; // suppress warning\n // mark the Injector as observer, to make it react to expressions in `grabStoresFn`,\n // see #111\n injected = observer(injected);\n injected.isMobxInjector = true; // restore warning\n return injected;\n };\n } else {\n var storeNames = [];\n for (var i = 0; i < arguments.length; i++) {\n storeNames[i] = arguments[i];\n }\n grabStoresFn = grabStoresByName(storeNames);\n return function (componentClass) {\n return createStoreInjector(grabStoresFn, componentClass, storeNames.join('-'));\n };\n }\n}\n\nfunction connect(arg1, arg2) {\n if (typeof arg1 === 'string') {\n throw new Error('Store names should be provided as array');\n }\n if (Array.isArray(arg1)) {\n if (!arg2) {\n // invoked as decorator\n return function (componentClass) {\n return connect(arg1, componentClass);\n };\n } else {\n return inject.apply(null, arg1)(connect(arg2));\n }\n }\n return observer(arg1);\n}\n\nvar specialReactKeys = { children: true, key: true, ref: true };\n\nvar logger$1 = console; // eslint-disable-line no-console\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n function Provider() {\n classCallCheck(this, Provider);\n return possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments));\n }\n\n createClass(Provider, [{\n key: 'render',\n value: function render(_ref) {\n var children = _ref.children;\n\n return children.length > 1 ? h(\n 'div',\n null,\n ' ',\n children,\n ' '\n ) : children[0];\n }\n }, {\n key: 'getChildContext',\n value: function getChildContext() {\n var stores = {};\n // inherit stores\n var baseStores = this.context.mobxStores;\n if (baseStores) {\n for (var key in baseStores) {\n stores[key] = baseStores[key];\n }\n }\n // add own stores\n for (var _key in this.props) {\n if (!specialReactKeys[_key] && _key !== 'suppressChangedStoreWarning') {\n stores[_key] = this.props[_key];\n }\n }\n\n return {\n mobxStores: stores\n };\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n // Maybe this warning is too aggressive?\n if (Object.keys(nextProps).length !== Object.keys(this.props).length) {\n logger$1.warn('MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children');\n }\n if (!nextProps.suppressChangedStoreWarning) {\n for (var key in nextProps) {\n if (!specialReactKeys[key] && this.props[key] !== nextProps[key]) {\n logger$1.warn('MobX Provider: Provided store \\'' + key + '\\' has changed. Please avoid replacing stores as the change might not propagate to all children');\n }\n }\n }\n }\n }]);\n return Provider;\n}(Component);\n\nif (!Component) {\n throw new Error('mobx-preact requires Preact to be available');\n}\n\nexport { observer, Observer, useStaticRendering, connect, inject, Provider };\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.JSONHTTPError = exports.TextHTTPError = exports.HTTPError = exports.getPagination = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _pagination = require(\"./pagination\");\n\nObject.defineProperty(exports, \"getPagination\", {\n enumerable: true,\n get: function get() {\n return _pagination.getPagination;\n }\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _extendableBuiltin(cls) {\n function ExtendableBuiltin() {\n var instance = Reflect.construct(cls, Array.from(arguments));\n Object.setPrototypeOf(instance, Object.getPrototypeOf(this));\n return instance;\n }\n\n ExtendableBuiltin.prototype = Object.create(cls.prototype, {\n constructor: {\n value: cls,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ExtendableBuiltin, cls);\n } else {\n ExtendableBuiltin.__proto__ = cls;\n }\n\n return ExtendableBuiltin;\n}\n\nvar HTTPError = exports.HTTPError = function (_extendableBuiltin2) {\n _inherits(HTTPError, _extendableBuiltin2);\n\n function HTTPError(response) {\n _classCallCheck(this, HTTPError);\n\n var _this = _possibleConstructorReturn(this, (HTTPError.__proto__ || Object.getPrototypeOf(HTTPError)).call(this, response.statusText));\n\n _this.name = _this.constructor.name;\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(_this, _this.constructor);\n } else {\n _this.stack = new Error(response.statusText).stack;\n }\n _this.status = response.status;\n return _this;\n }\n\n return HTTPError;\n}(_extendableBuiltin(Error));\n\nvar TextHTTPError = exports.TextHTTPError = function (_HTTPError) {\n _inherits(TextHTTPError, _HTTPError);\n\n function TextHTTPError(response, data) {\n _classCallCheck(this, TextHTTPError);\n\n var _this2 = _possibleConstructorReturn(this, (TextHTTPError.__proto__ || Object.getPrototypeOf(TextHTTPError)).call(this, response));\n\n _this2.data = data;\n return _this2;\n }\n\n return TextHTTPError;\n}(HTTPError);\n\nvar JSONHTTPError = exports.JSONHTTPError = function (_HTTPError2) {\n _inherits(JSONHTTPError, _HTTPError2);\n\n function JSONHTTPError(response, json) {\n _classCallCheck(this, JSONHTTPError);\n\n var _this3 = _possibleConstructorReturn(this, (JSONHTTPError.__proto__ || Object.getPrototypeOf(JSONHTTPError)).call(this, response));\n\n _this3.json = json;\n return _this3;\n }\n\n return JSONHTTPError;\n}(HTTPError);\n\nvar API = function () {\n function API() {\n var apiURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var options = arguments[1];\n\n _classCallCheck(this, API);\n\n this.apiURL = apiURL;\n if (this.apiURL.match(/\\/[^\\/]?/)) {\n // eslint-disable-line no-useless-escape\n this._sameOrigin = true;\n }\n this.defaultHeaders = options && options.defaultHeaders || {};\n }\n\n _createClass(API, [{\n key: \"headers\",\n value: function headers() {\n var _headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n return _extends({}, this.defaultHeaders, {\n \"Content-Type\": \"application/json\"\n }, _headers);\n }\n }, {\n key: \"parseJsonResponse\",\n value: function parseJsonResponse(response) {\n return response.json().then(function (json) {\n if (!response.ok) {\n return Promise.reject(new JSONHTTPError(response, json));\n }\n\n var pagination = (0, _pagination.getPagination)(response);\n return pagination ? { pagination: pagination, items: json } : json;\n });\n }\n }, {\n key: \"request\",\n value: function request(path) {\n var _this4 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var headers = this.headers(options.headers || {});\n if (this._sameOrigin) {\n options.credentials = options.credentials || \"same-origin\";\n }\n return fetch(this.apiURL + path, _extends({}, options, { headers: headers })).then(function (response) {\n var contentType = response.headers.get(\"Content-Type\");\n if (contentType && contentType.match(/json/)) {\n return _this4.parseJsonResponse(response);\n }\n\n if (!response.ok) {\n return response.text().then(function (data) {\n return Promise.reject(new TextHTTPError(response, data));\n });\n }\n return response.text().then(function (data) {\n data;\n });\n });\n }\n }]);\n\n return API;\n}();\n\nexports.default = API;","import { h, Component } from \"preact\";\n\nexport default class Button extends Component {\n render() {\n const { saving, text, saving_text } = this.props;\n\n return (\n \n );\n }\n}\n","import { h, Component } from \"preact\";\n\nconst messages = {\n confirm: {\n type: \"success\",\n text: \"message_confirm\"\n },\n password_mail: {\n type: \"success\",\n text: \"message_password_mail\"\n },\n email_changed: {\n type: \"sucess\",\n text: \"message_email_changed\"\n },\n verfication_error: {\n type: \"error\",\n text: \"message_verfication_error\"\n },\n signup_disabled: {\n type: \"error\",\n text: \"message_signup_disabled\"\n }\n};\n\nexport default class Message extends Component {\n render() {\n const { type, t } = this.props;\n const msg = messages[type];\n\n return (\n
\n {t(msg.text)}\n
\n );\n }\n}\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import netlifyIdentity from \"./netlify-identity\";\n\nif (typeof exports !== undefined) {\n exports.netlifyIdentity = netlifyIdentity;\n}\nif (typeof window !== undefined) {\n window.netlifyIdentity = netlifyIdentity;\n}\nif (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n netlifyIdentity.init();\n });\n} else {\n netlifyIdentity.init();\n}\n","import { h, render } from \"preact\";\nimport { observe } from \"mobx\";\nimport { Provider } from \"mobx-preact\";\nimport GoTrue from \"gotrue-js\";\nimport App from \"./components/app\";\nimport store from \"./state/store\";\nimport Controls from \"./components/controls\";\nimport modalCSS from \"./components/modal.css\";\n\nconst callbacks = {};\nfunction trigger(callback) {\n const cbMap = callbacks[callback] || new Set();\n Array.from(cbMap.values()).forEach((cb) => {\n cb.apply(cb, Array.prototype.slice.call(arguments, 1));\n });\n}\n\nconst validActions = {\n login: true,\n signup: true,\n error: true\n};\n\nconst netlifyIdentity = {\n on: (event, cb) => {\n callbacks[event] = callbacks[event] || new Set();\n callbacks[event].add(cb);\n },\n off: (event, cb) => {\n if (callbacks[event]) {\n if (cb) {\n callbacks[event].delete(cb);\n } else {\n callbacks[event].clear();\n }\n }\n },\n open: (action) => {\n action = action || \"login\";\n if (!validActions[action]) {\n throw new Error(`Invalid action for open: ${action}`);\n }\n store.openModal(store.user ? \"user\" : action);\n },\n close: () => {\n store.closeModal();\n },\n currentUser: () => {\n return store.gotrue && store.gotrue.currentUser();\n },\n logout: () => {\n return store.logout();\n },\n get gotrue() {\n if (!store.gotrue) {\n store.openModal(\"login\");\n }\n return store.gotrue;\n },\n refresh(force) {\n if (!store.gotrue) {\n store.openModal(\"login\");\n }\n return store.gotrue.currentUser().jwt(force);\n },\n init: (options) => {\n init(options);\n },\n setLocale: (locale) => {\n if (locale) {\n store.locale = locale;\n }\n },\n store\n};\n\nlet queuedIframeStyle = null;\nfunction setStyle(el, css) {\n let style = \"\";\n for (const key in css) {\n style += `${key}: ${css[key]}; `;\n }\n if (el) {\n el.setAttribute(\"style\", style);\n } else {\n queuedIframeStyle = style;\n }\n}\n\nconst localHosts = {\n localhost: true,\n \"127.0.0.1\": true,\n \"0.0.0.0\": true\n};\n\nfunction instantiateGotrue(APIUrl) {\n const isLocal = localHosts[document.location.hostname];\n if (APIUrl) {\n return new GoTrue({ APIUrl, setCookie: !isLocal });\n }\n if (isLocal) {\n store.setIsLocal(isLocal);\n const siteURL = localStorage.getItem(\"netlifySiteURL\");\n if (siteURL) {\n // setting a siteURL will invoke instantiateGotrue again with the relevant APIUrl\n store.setSiteURL(siteURL);\n }\n return null;\n }\n\n return new GoTrue({ setCookie: !isLocal });\n}\n\nlet root;\nlet iframe;\nconst iframeStyle = {\n position: \"fixed\",\n top: 0,\n left: 0,\n border: \"none\",\n width: \"100%\",\n height: \"100%\",\n overflow: \"visible\",\n background: \"transparent\",\n display: \"none\",\n \"z-index\": 99\n};\n\nobserve(store.modal, \"isOpen\", () => {\n if (!store.settings) {\n store.loadSettings();\n }\n setStyle(iframe, {\n ...iframeStyle,\n display: store.modal.isOpen ? \"block !important\" : \"none\"\n });\n if (store.modal.isOpen) {\n trigger(\"open\", store.modal.page);\n } else {\n trigger(\"close\");\n }\n});\n\nobserve(store, \"siteURL\", () => {\n if (store.siteURL === null || store.siteURL === undefined) {\n localStorage.removeItem(\"netlifySiteURL\");\n } else {\n localStorage.setItem(\"netlifySiteURL\", store.siteURL);\n }\n\n let apiUrl;\n if (store.siteURL) {\n const siteUrl = store.siteURL.replace(/\\/$/, \"\");\n apiUrl = `${siteUrl}/.netlify/identity`;\n }\n store.init(instantiateGotrue(apiUrl), true);\n});\n\nobserve(store, \"user\", () => {\n if (store.user) {\n trigger(\"login\", store.user);\n } else {\n trigger(\"logout\");\n }\n});\n\nobserve(store, \"gotrue\", () => {\n store.gotrue && trigger(\"init\", store.gotrue.currentUser());\n});\n\nobserve(store, \"error\", () => {\n trigger(\"error\", store.error);\n});\n\nconst routes = /(confirmation|invite|recovery|email_change)_token=([^&]+)/;\nconst errorRoute = /error=access_denied&error_description=403/;\nconst accessTokenRoute = /access_token=/;\n\nfunction runRoutes() {\n const hash = (document.location.hash || \"\").replace(/^#\\/?/, \"\");\n if (!hash) {\n return;\n }\n\n const m = hash.match(routes);\n if (m) {\n store.verifyToken(m[1], m[2]);\n document.location.hash = \"\";\n }\n\n const em = hash.match(errorRoute);\n if (em) {\n store.openModal(\"signup\");\n document.location.hash = \"\";\n }\n\n const am = hash.match(accessTokenRoute);\n if (am) {\n const params = {};\n hash.split(\"&\").forEach((pair) => {\n const [key, value] = pair.split(\"=\");\n params[key] = value;\n });\n if (!!document && params[\"access_token\"]) {\n document.cookie = `nf_jwt=${params[\"access_token\"]}`;\n }\n if (params[\"state\"]) {\n try {\n // skip initialization for implicit auth\n const state = decodeURIComponent(params[\"state\"]);\n const { auth_type } = JSON.parse(state);\n if (auth_type === \"implicit\") {\n return;\n }\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n document.location.hash = \"\";\n store.openModal(\"login\");\n store.completeExternalLogin(params);\n }\n}\n\nfunction init(options = {}) {\n const { APIUrl, logo = true, namePlaceholder, locale } = options;\n\n if (locale) {\n store.locale = locale;\n }\n\n const controlEls = document.querySelectorAll(\n \"[data-netlify-identity-menu],[data-netlify-identity-button]\"\n );\n Array.prototype.slice.call(controlEls).forEach((el) => {\n let controls = null;\n const mode =\n el.getAttribute(\"data-netlify-identity-menu\") === null\n ? \"button\"\n : \"menu\";\n render(\n \n \n ,\n el,\n controls\n );\n });\n\n store.init(instantiateGotrue(APIUrl));\n store.modal.logo = logo;\n store.setNamePlaceholder(namePlaceholder);\n iframe = document.createElement(\"iframe\");\n iframe.id = \"netlify-identity-widget\";\n iframe.title = \"Netlify identity widget\";\n iframe.onload = () => {\n const styles = iframe.contentDocument.createElement(\"style\");\n styles.innerHTML = modalCSS.toString();\n iframe.contentDocument.head.appendChild(styles);\n root = render(\n \n \n ,\n iframe.contentDocument.body,\n root\n );\n runRoutes();\n };\n setStyle(iframe, iframeStyle);\n iframe.src = \"about:blank\";\n const container = options.container\n ? document.querySelector(options.container)\n : document.body;\n container.appendChild(iframe);\n /* There's a certain case where we might have called setStyle before the iframe was ready.\n\t Make sure we take the last style and apply it */\n if (queuedIframeStyle) {\n iframe.setAttribute(\"style\", queuedIframeStyle);\n queuedIframeStyle = null;\n }\n}\n\nexport default netlifyIdentity;\n","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _microApiClient = _interopRequireWildcard(require(\"micro-api-client\"));\n\nvar _user = _interopRequireDefault(require(\"./user\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar HTTPRegexp = /^http:\\/\\//;\nvar defaultApiURL = \"/.netlify/identity\";\n\nvar GoTrue = /*#__PURE__*/function () {\n function GoTrue() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$APIUrl = _ref.APIUrl,\n APIUrl = _ref$APIUrl === void 0 ? defaultApiURL : _ref$APIUrl,\n _ref$audience = _ref.audience,\n audience = _ref$audience === void 0 ? '' : _ref$audience,\n _ref$setCookie = _ref.setCookie,\n setCookie = _ref$setCookie === void 0 ? false : _ref$setCookie;\n\n _classCallCheck(this, GoTrue);\n\n if (APIUrl.match(HTTPRegexp)) {\n console.warn('Warning:\\n\\nDO NOT USE HTTP IN PRODUCTION FOR GOTRUE EVER!\\nGoTrue REQUIRES HTTPS to work securely.');\n }\n\n if (audience) {\n this.audience = audience;\n }\n\n this.setCookie = setCookie;\n this.api = new _microApiClient[\"default\"](APIUrl);\n }\n\n _createClass(GoTrue, [{\n key: \"_request\",\n value: function _request(path) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options.headers = options.headers || {};\n var aud = options.audience || this.audience;\n\n if (aud) {\n options.headers['X-JWT-AUD'] = aud;\n }\n\n return this.api.request(path, options)[\"catch\"](function (err) {\n if (err instanceof _microApiClient.JSONHTTPError && err.json) {\n if (err.json.msg) {\n err.message = err.json.msg;\n } else if (err.json.error) {\n err.message = \"\".concat(err.json.error, \": \").concat(err.json.error_description);\n }\n }\n\n return Promise.reject(err);\n });\n }\n }, {\n key: \"settings\",\n value: function settings() {\n return this._request('/settings');\n }\n }, {\n key: \"signup\",\n value: function signup(email, password, data) {\n return this._request('/signup', {\n method: 'POST',\n body: JSON.stringify({\n email: email,\n password: password,\n data: data\n })\n });\n }\n }, {\n key: \"login\",\n value: function login(email, password, remember) {\n var _this = this;\n\n this._setRememberHeaders(remember);\n\n return this._request('/token', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: \"grant_type=password&username=\".concat(encodeURIComponent(email), \"&password=\").concat(encodeURIComponent(password))\n }).then(function (response) {\n _user[\"default\"].removeSavedSession();\n\n return _this.createUser(response, remember);\n });\n }\n }, {\n key: \"loginExternalUrl\",\n value: function loginExternalUrl(provider) {\n return \"\".concat(this.api.apiURL, \"/authorize?provider=\").concat(provider);\n }\n }, {\n key: \"confirm\",\n value: function confirm(token, remember) {\n this._setRememberHeaders(remember);\n\n return this.verify('signup', token, remember);\n }\n }, {\n key: \"requestPasswordRecovery\",\n value: function requestPasswordRecovery(email) {\n return this._request('/recover', {\n method: 'POST',\n body: JSON.stringify({\n email: email\n })\n });\n }\n }, {\n key: \"recover\",\n value: function recover(token, remember) {\n this._setRememberHeaders(remember);\n\n return this.verify('recovery', token, remember);\n }\n }, {\n key: \"acceptInvite\",\n value: function acceptInvite(token, password, remember) {\n var _this2 = this;\n\n this._setRememberHeaders(remember);\n\n return this._request('/verify', {\n method: 'POST',\n body: JSON.stringify({\n token: token,\n password: password,\n type: 'signup'\n })\n }).then(function (response) {\n return _this2.createUser(response, remember);\n });\n }\n }, {\n key: \"acceptInviteExternalUrl\",\n value: function acceptInviteExternalUrl(provider, token) {\n return \"\".concat(this.api.apiURL, \"/authorize?provider=\").concat(provider, \"&invite_token=\").concat(token);\n }\n }, {\n key: \"createUser\",\n value: function createUser(tokenResponse) {\n var remember = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n this._setRememberHeaders(remember);\n\n var user = new _user[\"default\"](this.api, tokenResponse, this.audience);\n return user.getUserData().then(function (user) {\n if (remember) {\n user._saveSession();\n }\n\n return user;\n });\n }\n }, {\n key: \"currentUser\",\n value: function currentUser() {\n var user = _user[\"default\"].recoverSession(this.api);\n\n user && this._setRememberHeaders(user._fromStorage);\n return user;\n }\n }, {\n key: \"verify\",\n value: function verify(type, token, remember) {\n var _this3 = this;\n\n this._setRememberHeaders(remember);\n\n return this._request('/verify', {\n method: 'POST',\n body: JSON.stringify({\n token: token,\n type: type\n })\n }).then(function (response) {\n return _this3.createUser(response, remember);\n });\n }\n }, {\n key: \"_setRememberHeaders\",\n value: function _setRememberHeaders(remember) {\n if (this.setCookie) {\n this.api.defaultHeaders = this.api.defaultHeaders || {};\n this.api.defaultHeaders['X-Use-Cookie'] = remember ? '1' : 'session';\n }\n }\n }]);\n\n return GoTrue;\n}();\n\nexports[\"default\"] = GoTrue;\n\nif (typeof window !== 'undefined') {\n window.GoTrue = GoTrue;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.getPagination = getPagination;\nfunction getPagination(response) {\n var links = response.headers.get(\"Link\");\n var pagination = {};\n //var link, url, rel, m, page;\n if (links == null) {\n return null;\n }\n links = links.split(\",\");\n var total = response.headers.get(\"X-Total-Count\");\n\n for (var i = 0, len = links.length; i < len; i++) {\n var link = links[i].replace(/(^\\s*|\\s*$)/, \"\");\n\n var _link$split = link.split(\";\"),\n _link$split2 = _slicedToArray(_link$split, 2),\n url = _link$split2[0],\n rel = _link$split2[1];\n\n var m = url.match(/page=(\\d+)/);\n var page = m && parseInt(m[1], 10);\n if (rel.match(/last/)) {\n pagination.last = page;\n } else if (rel.match(/next/)) {\n pagination.next = page;\n } else if (rel.match(/prev/)) {\n pagination.prev = page;\n } else if (rel.match(/first/)) {\n pagination.first = page;\n }\n }\n\n pagination.last = Math.max(pagination.last || 0, pagination.prev && pagination.prev + 1 || 0);\n pagination.current = pagination.next ? pagination.next - 1 : pagination.last || 1;\n pagination.total = total ? parseInt(total, 10) : null;\n\n return pagination;\n}","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _microApiClient = _interopRequireWildcard(require(\"micro-api-client\"));\n\nvar _admin = _interopRequireDefault(require(\"./admin\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar ExpiryMargin = 60 * 1000;\nvar storageKey = 'gotrue.user';\nvar refreshPromises = {};\nvar currentUser = null;\nvar forbiddenUpdateAttributes = {\n api: 1,\n token: 1,\n audience: 1,\n url: 1\n};\nvar forbiddenSaveAttributes = {\n api: 1\n};\n\nvar isBrowser = function isBrowser() {\n return typeof window !== 'undefined';\n};\n\nvar User = /*#__PURE__*/function () {\n function User(api, tokenResponse, audience) {\n _classCallCheck(this, User);\n\n this.api = api;\n this.url = api.apiURL;\n this.audience = audience;\n\n this._processTokenResponse(tokenResponse);\n\n currentUser = this;\n }\n\n _createClass(User, [{\n key: \"update\",\n value: function update(attributes) {\n var _this = this;\n\n return this._request('/user', {\n method: 'PUT',\n body: JSON.stringify(attributes)\n }).then(function (response) {\n return _this._saveUserData(response)._refreshSavedSession();\n });\n }\n }, {\n key: \"jwt\",\n value: function jwt(forceRefresh) {\n var token = this.tokenDetails();\n\n if (token === null || token === undefined) {\n return Promise.reject(new Error(\"Gotrue-js: failed getting jwt access token\"));\n }\n\n var expires_at = token.expires_at,\n refresh_token = token.refresh_token,\n access_token = token.access_token;\n\n if (forceRefresh || expires_at - ExpiryMargin < Date.now()) {\n return this._refreshToken(refresh_token);\n }\n\n return Promise.resolve(access_token);\n }\n }, {\n key: \"logout\",\n value: function logout() {\n return this._request('/logout', {\n method: 'POST'\n }).then(this.clearSession.bind(this))[\"catch\"](this.clearSession.bind(this));\n }\n }, {\n key: \"_refreshToken\",\n value: function _refreshToken(refresh_token) {\n var _this2 = this;\n\n if (refreshPromises[refresh_token]) {\n return refreshPromises[refresh_token];\n }\n\n return refreshPromises[refresh_token] = this.api.request('/token', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: \"grant_type=refresh_token&refresh_token=\".concat(refresh_token)\n }).then(function (response) {\n delete refreshPromises[refresh_token];\n\n _this2._processTokenResponse(response);\n\n _this2._refreshSavedSession();\n\n return _this2.token.access_token;\n })[\"catch\"](function (error) {\n delete refreshPromises[refresh_token];\n\n _this2.clearSession();\n\n return Promise.reject(error);\n });\n }\n }, {\n key: \"_request\",\n value: function _request(path) {\n var _this3 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options.headers = options.headers || {};\n var aud = options.audience || this.audience;\n\n if (aud) {\n options.headers['X-JWT-AUD'] = aud;\n }\n\n return this.jwt().then(function (token) {\n return _this3.api.request(path, _objectSpread({\n headers: Object.assign(options.headers, {\n Authorization: \"Bearer \".concat(token)\n })\n }, options))[\"catch\"](function (err) {\n if (err instanceof _microApiClient.JSONHTTPError && err.json) {\n if (err.json.msg) {\n err.message = err.json.msg;\n } else if (err.json.error) {\n err.message = \"\".concat(err.json.error, \": \").concat(err.json.error_description);\n }\n }\n\n return Promise.reject(err);\n });\n });\n }\n }, {\n key: \"getUserData\",\n value: function getUserData() {\n return this._request('/user').then(this._saveUserData.bind(this)).then(this._refreshSavedSession.bind(this));\n }\n }, {\n key: \"_saveUserData\",\n value: function _saveUserData(attributes, fromStorage) {\n for (var key in attributes) {\n if (key in User.prototype || key in forbiddenUpdateAttributes) {\n continue;\n }\n\n this[key] = attributes[key];\n }\n\n if (fromStorage) {\n this._fromStorage = true;\n }\n\n return this;\n }\n }, {\n key: \"_processTokenResponse\",\n value: function _processTokenResponse(tokenResponse) {\n this.token = tokenResponse;\n var claims;\n\n try {\n claims = JSON.parse(urlBase64Decode(tokenResponse.access_token.split('.')[1]));\n this.token.expires_at = claims.exp * 1000;\n } catch (e) {\n console.error(new Error(\"Gotrue-js: Failed to parse tokenResponse claims: \".concat(JSON.stringify(tokenResponse))));\n }\n }\n }, {\n key: \"_refreshSavedSession\",\n value: function _refreshSavedSession() {\n // only update saved session if we previously saved something\n if (isBrowser() && localStorage.getItem(storageKey)) {\n this._saveSession();\n }\n\n return this;\n }\n }, {\n key: \"_saveSession\",\n value: function _saveSession() {\n isBrowser() && localStorage.setItem(storageKey, JSON.stringify(this._details));\n return this;\n }\n }, {\n key: \"tokenDetails\",\n value: function tokenDetails() {\n return this.token;\n }\n }, {\n key: \"clearSession\",\n value: function clearSession() {\n User.removeSavedSession();\n this.token = null;\n currentUser = null;\n }\n }, {\n key: \"admin\",\n get: function get() {\n return new _admin[\"default\"](this);\n }\n }, {\n key: \"_details\",\n get: function get() {\n var userCopy = {};\n\n for (var key in this) {\n if (key in User.prototype || key in forbiddenSaveAttributes) {\n continue;\n }\n\n userCopy[key] = this[key];\n }\n\n return userCopy;\n }\n }], [{\n key: \"removeSavedSession\",\n value: function removeSavedSession() {\n isBrowser() && localStorage.removeItem(storageKey);\n }\n }, {\n key: \"recoverSession\",\n value: function recoverSession(apiInstance) {\n if (currentUser) {\n return currentUser;\n }\n\n var json = isBrowser() && localStorage.getItem(storageKey);\n\n if (json) {\n try {\n var data = JSON.parse(json);\n var url = data.url,\n token = data.token,\n audience = data.audience;\n\n if (!url || !token) {\n return null;\n }\n\n var api = apiInstance || new _microApiClient[\"default\"](url, {});\n return new User(api, token, audience)._saveUserData(data, true);\n } catch (ex) {\n console.error(new Error(\"Gotrue-js: Error recovering session: \".concat(ex)));\n return null;\n }\n }\n\n return null;\n }\n }]);\n\n return User;\n}();\n\nexports[\"default\"] = User;\n\nfunction urlBase64Decode(str) {\n // From https://jwt.io/js/jwt.js\n var output = str.replace(/-/g, '+').replace(/_/g, '/');\n\n switch (output.length % 4) {\n case 0:\n break;\n\n case 2:\n output += '==';\n break;\n\n case 3:\n output += '=';\n break;\n\n default:\n throw 'Illegal base64url string!';\n }\n\n var result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\n try {\n return decodeURIComponent(escape(result));\n } catch (err) {\n return result;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar Admin = /*#__PURE__*/function () {\n function Admin(user) {\n _classCallCheck(this, Admin);\n\n this.user = user;\n } // Return a list of all users in an audience\n\n\n _createClass(Admin, [{\n key: \"listUsers\",\n value: function listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud\n });\n }\n }, {\n key: \"getUser\",\n value: function getUser(user) {\n return this.user._request(\"/admin/users/\".concat(user.id));\n }\n }, {\n key: \"updateUser\",\n value: function updateUser(user) {\n var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.user._request(\"/admin/users/\".concat(user.id), {\n method: 'PUT',\n body: JSON.stringify(attributes)\n });\n }\n }, {\n key: \"createUser\",\n value: function createUser(email, password) {\n var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n attributes.email = email;\n attributes.password = password;\n return this.user._request('/admin/users', {\n method: 'POST',\n body: JSON.stringify(attributes)\n });\n }\n }, {\n key: \"deleteUser\",\n value: function deleteUser(user) {\n return this.user._request(\"/admin/users/\".concat(user.id), {\n method: 'DELETE'\n });\n }\n }]);\n\n return Admin;\n}();\n\nexports[\"default\"] = Admin;","import { h, Component } from \"preact\";\nimport { connect } from \"mobx-preact\";\nimport Modal from \"./modal\";\nimport SiteURLForm from \"./forms/siteurl\";\nimport LogoutForm from \"./forms/logout\";\nimport UserForm from \"./forms/user\";\nimport Providers from \"./forms/providers\";\nimport Message from \"./forms/message\";\n\nconst pagesWithHeader = { login: true, signup: true };\nconst pages = {\n login: {\n login: true,\n button: \"log_in\",\n button_saving: \"logging_in\",\n email: true,\n password: \"current-password\",\n link: \"amnesia\",\n link_text: \"forgot_password\",\n providers: true\n },\n signup: {\n signup: true,\n button: \"sign_up\",\n button_saving: \"signing_up\",\n name: true,\n email: true,\n password: \"new-password\",\n providers: true\n },\n amnesia: {\n title: \"recover_password\",\n button: \"send_recovery_email\",\n button_saving: \"sending_recovery_email\",\n email: true,\n link: \"login\",\n link_text: \"never_mind\"\n },\n recovery: {\n title: \"recover_password\",\n button: \"update_password\",\n button_saving: \"updating_password\",\n password: \"new-password\",\n link: \"login\",\n link_text: \"never_mind\"\n },\n invite: {\n title: \"complete_your_signup\",\n button: \"sign_up\",\n button_saving: \"signing_up\",\n password: \"new-password\",\n providers: true\n },\n user: {\n title: \"logged_in\"\n }\n};\n\n@connect([\"store\"])\nclass App extends Component {\n handleClose = () => this.props.store.closeModal();\n handlePage = (page) => this.props.store.openModal(page);\n handleLogout = () => this.props.store.logout();\n handleSiteURL = (url) => this.props.store.setSiteURL(url);\n clearSiteURL = (url) => this.props.store.clearSiteURL();\n clearStoreError = () => this.props.store.setError();\n handleExternalLogin = (provider) => this.props.store.externalLogin(provider);\n handleUser = ({ name, email, password }) => {\n const { store } = this.props;\n\n switch (store.modal.page) {\n case \"login\":\n store.login(email, password);\n break;\n case \"signup\":\n store.signup(name, email, password);\n break;\n case \"amnesia\":\n store.requestPasswordRecovery(email);\n break;\n case \"invite\":\n store.acceptInvite(password);\n break;\n case \"recovery\":\n store.updatePassword(password);\n break;\n }\n };\n\n renderBody() {\n const { store } = this.props;\n const page = pages[store.modal.page] || {};\n const pageLinkHandler = () => this.handlePage(page.link);\n\n if (store.isLocal && store.siteURL === null) {\n return (\n \n );\n }\n if (!store.settings) {\n return;\n }\n if (store.user) {\n return (\n \n );\n }\n if (store.modal.page === \"signup\" && store.settings.disable_signup) {\n return ;\n }\n\n return (\n
\n \n {!store.user && page.link && store.gotrue && (\n \n {store.translate(page.link_text)}\n \n )}\n {store.isLocal ? (\n \n ) : (\n
\n )}\n
\n );\n }\n\n renderProviders() {\n const { store } = this.props;\n\n if (!(store.gotrue && store.settings)) {\n return null;\n }\n if (store.modal.page === \"signup\" && store.settings.disable_signup) {\n return null;\n }\n const page = pages[store.modal.page] || {};\n\n if (!page.providers) {\n return null;\n }\n\n const providers = [\n \"Google\",\n \"GitHub\",\n \"GitLab\",\n \"BitBucket\",\n \"SAML\"\n ].filter((p) => store.settings.external[p.toLowerCase()]);\n\n return providers.length ? (\n \n ) : null;\n }\n\n render() {\n const { store } = this.props;\n const showHeader = pagesWithHeader[store.modal.page];\n const showSignup = store.settings && !store.settings.disable_signup;\n const page = pages[store.modal.page] || {};\n\n return (\n
\n \n {this.renderBody()}\n {this.renderProviders()}\n \n
\n );\n }\n}\n\nexport default App;\n","import { h, Component } from \"preact\";\n\nfunction formatError(error) {\n return (\n (error.json && error.json.error_description) ||\n error.message ||\n error.toString()\n );\n}\n\nexport default class Modal extends Component {\n handleClose = (e) => {\n e.preventDefault();\n this.props.onClose();\n };\n\n blockEvent = (e) => {\n e.stopPropagation();\n };\n\n linkHandler = (page) => (e) => {\n e.preventDefault();\n this.props.onPage(page);\n };\n\n render() {\n const {\n page,\n error,\n loading,\n showHeader,\n showSignup,\n devSettings,\n isOpen,\n children,\n logo,\n t,\n isLocal,\n clearSiteURL,\n clearStoreError\n } = this.props;\n const hidden = loading || !isOpen;\n const formattedError = error ? formatError(error) : null;\n return (\n \n \n
\n \n {showHeader && (\n
\n {showSignup && (\n \n {t(\"sign_up\")}\n \n )}\n {!devSettings && (\n \n {t(\"log_in\")}\n \n )}\n
\n )}\n {page.title && (\n
\n \n
\n )}\n {devSettings && (\n
\n \n
\n )}\n {formattedError && (\n
\n {t(formattedError)}\n
\n )}\n {isLocal &&\n formattedError &&\n formattedError.includes(\"Failed to load settings from\") && (\n
\n {\n clearSiteURL(e);\n clearStoreError();\n }}\n className=\"btnLink forgotPasswordLink\"\n >\n {t(\"site_url_link_text\")}\n \n
\n )}\n {children}\n
\n
\n {logo && (\n \n \n {t(\"coded_by\")}\n \n )}\n \n );\n }\n}\n","import { h, Component } from \"preact\";\n\nexport default class SiteURLForm extends Component {\n constructor(props) {\n super(props);\n this.state = { url: \"\", development: props.devMode || false };\n }\n\n handleInput = (e) => {\n this.setState({ [e.target.name]: e.target.value });\n };\n\n addSiteURL = (e) => {\n e.preventDefault();\n this.props.onSiteURL(this.state.url);\n };\n\n clearSiteURL = (e) => {\n e.preventDefault;\n this.props.onSiteURL();\n };\n\n render() {\n const { url, development } = this.state;\n const { t } = this.props;\n\n return (\n
\n {development ? (\n
\n

{t(\"site_url_title\")}

\n this.clearSiteURL(e)}\n className=\"btnLink forgotPasswordLink\"\n >\n {t(\"site_url_link_text\")}\n \n
\n ) : (\n
\n
{t(\"site_url_message\")}
\n
\n
\n );\n }\n}\n","import { h, Component } from \"preact\";\nimport Button from \"./button\";\n\nexport default class LogoutForm extends Component {\n handleLogout = (e) => {\n e.preventDefault();\n this.props.onLogout();\n };\n render() {\n const { user, saving, t } = this.props;\n\n return (\n \n

\n {t(\"logged_in_as\")}
\n \n {user.user_metadata.full_name ||\n user.user_metadata.name ||\n user.email}\n \n

\n \n \n );\n }\n}\n","import { h, Component } from \"preact\";\nimport Message from \"./message\";\nimport Button from \"./button\";\n\nexport default class UserForm extends Component {\n constructor(props) {\n super(props);\n this.state = { name: \"\", email: \"\", password: \"\" };\n }\n\n handleInput = (e) => {\n this.setState({ [e.target.name]: e.target.value });\n };\n\n handleLogin = (e) => {\n e.preventDefault();\n this.props.onSubmit(this.state);\n };\n\n render() {\n const { page, message, saving, namePlaceholder, t } = this.props;\n const { name, email, password } = this.state;\n\n return (\n \n {message && }\n {page.name && (\n
\n