falcor
Version:
A JavaScript library for efficient data fetching.
1 lines • 153 kB
JavaScript
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).falcor=t()}(function(){return function i(s,a,u){function c(e,t){if(!a[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(f)return f(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=a[e]={exports:{}};s[e][0].call(o.exports,function(t){return c(s[e][1][t]||t)},o,o.exports,i,s,a,u)}return a[e].exports}for(var f="function"==typeof require&&require,t=0;t<u.length;t++)c(u[t]);return c}({1:[function(t,e,r){var n=t(2),o=t(239);n.Router=o,e.exports=n},{2:2,239:239}],2:[function(t,e,r){var n=t(34),o=t(121);n.atom=o.atom,n.ref=o.ref,n.error=o.error,n.pathValue=o.pathValue,n.HttpDataSource=t(116),e.exports=n},{116:116,121:121,34:34}],3:[function(t,e,r){function n(){}var o=t(5),i=t(4),s=t(44),a=t(52),u=t(50),c=t(51),f=t(66),h=t(65),l=t(40),p=t(125),d=t(78),v=t(90),y=t(92),b=t(88),_=t(89),m=t(68),g=t(67),x=t(121),w=0,O=t(106),S=t(19),E=t(24),P=t(59);function k(t){var e=t||{};this._root=e._root||new o(e),this._path=e.path||e._path||[],this._source=e.source||e._source,this._request=e.request||e._request||new s(this,e.scheduler||new h),this._ID=w++,"number"==typeof e.maxSize?this._maxSize=e.maxSize:this._maxSize=e._maxSize||k.prototype._maxSize,"number"==typeof e.maxRetries?this._maxRetries=e.maxRetries:this._maxRetries=e._maxRetries||k.prototype._maxRetries,"number"==typeof e.collectRatio?this._collectRatio=e.collectRatio:this._collectRatio=e._collectRatio||k.prototype._collectRatio,(e.boxed||e.hasOwnProperty("_boxed"))&&(this._boxed=e.boxed||e._boxed),(e.materialized||e.hasOwnProperty("_materialized"))&&(this._materialized=e.materialized||e._materialized),"boolean"==typeof e.treatErrorsAsValues?this._treatErrorsAsValues=e.treatErrorsAsValues:e.hasOwnProperty("_treatErrorsAsValues")?this._treatErrorsAsValues=e._treatErrorsAsValues:this._treatErrorsAsValues=!1,"boolean"==typeof e.disablePathCollapse?this._enablePathCollapse=!e.disablePathCollapse:e.hasOwnProperty("_enablePathCollapse")?this._enablePathCollapse=e._enablePathCollapse:this._enablePathCollapse=!0,"boolean"==typeof e.disableRequestDeduplication?this._enableRequestDeduplication=!e.disableRequestDeduplication:e.hasOwnProperty("_enableRequestDeduplication")?this._enableRequestDeduplication=e._enableRequestDeduplication:this._enableRequestDeduplication=!0,this._useServerPaths=e._useServerPaths||!1,this._allowFromWhenceYouCame=e.allowFromWhenceYouCame||e._allowFromWhenceYouCame||!1,this._treatDataSourceErrorsAsJSONGraphErrors=e._treatDataSourceErrorsAsJSONGraphErrors||!1,e.cache&&this.setCache(e.cache)}(e.exports=k).ref=x.ref,k.atom=x.atom,k.error=x.error,k.pathValue=x.pathValue,(k.prototype.constructor=k).prototype._materialized=!1,k.prototype._boxed=!1,k.prototype._progressive=!1,k.prototype._treatErrorsAsValues=!1,k.prototype._maxSize=Math.pow(2,53)-1,k.prototype._maxRetries=3,k.prototype._collectRatio=.75,k.prototype._enablePathCollapse=!0,k.prototype._enableRequestDeduplication=!0,k.prototype.get=t(58),k.prototype._getOptimizedBoundPath=function(){return this._path?this._path.slice():this._path},k.prototype._getWithPaths=t(57),k.prototype.set=t(61),k.prototype.preload=function(){var e=O(arguments,P,"preload");if(!0!==e)return new a(function(t){t.onError(e)});var t=Array.prototype.slice.call(arguments),r=this;return new a(function(e){return r.get.apply(r,t).subscribe(function(){},function(t){e.onError(t)},function(){e.onCompleted()})})},k.prototype.call=function(){for(var t=-1,e=arguments.length,r=new Array(e);++t<e;){var n=arguments[t],o=typeof(r[t]=n);if(1<t&&!Array.isArray(n)||0===t&&!Array.isArray(n)&&"string"!=o||1===t&&!Array.isArray(n)&&!y(n))return new a(function(t){t.onError(new Error("Invalid argument"))})}return new u(this,r[0],r[1],r[2],r[3])},k.prototype.invalidate=function(){for(var t=-1,e=arguments.length,r=[];++t<e;)if(r[t]=p.fromPath(arguments[t]),!Array.isArray(r[t])||!r[t].length)throw new Error("Invalid argument");new c(this,r).subscribe(n,function(t){throw t})},k.prototype.deref=t(7),k.prototype._hasValidParentReference=t(6),k.prototype.getValue=t(21),k.prototype.setValue=t(70),k.prototype._getValueSync=t(29),k.prototype._setValueSync=t(71),k.prototype._derefSync=t(8),k.prototype.setCache=function(t){var e,r,n,o=this._root.cache;return t!==o?(e=this._root,r=this._path,this._path=[],this._root.cache={},void 0!==o&&l(e,e.expired,d(o),0),_(t)?n=g(this,[t])[0]:b(t)?n=m(this,[t])[0]:v(t)&&(n=m(this,[{json:t}])[0]),n&&E.getWithPathsAsPathMap(this,n,[]),this._path=r):void 0===o&&(this._root.cache={}),this},k.prototype.getCache=function(){var t=Array.prototype.slice.call(arguments);if(0===t.length)return S(this._root.cache);var e=[{}],r=this._path;return E.getWithPathsAsJSONGraph(this,t,e),this._path=r,e[0].jsonGraph},k.prototype._setMaxSize=function(t){var e,r,n,o=this._maxSize;(this._maxSize=t)<o&&(n=(r=(e=this._root).cache).$_version,l(e,e.expired,d(r),this._maxSize,this._collectRatio,n))},k.prototype.getVersion=function(t){var e=t&&p.fromPath(t)||[];if(!1===Array.isArray(e))throw new Error("Model#getVersion must be called with an Array path.");return this._path.length&&(e=this._path.concat(e)),this._getVersion(this,e)},k.prototype._syncCheck=function(t){if(Boolean(this._source)&&this._root.syncRefCount<=0&&!1===this._root.unsafeMode)throw new Error("Model#"+t+" may only be called within the context of a request selector.");return!0},k.prototype._clone=function(t){var e=new this.constructor(this);for(var r in t){var n=t[r];"delete"===n?delete e[r]:e[r]=n}return e.setCache=void 0,e},k.prototype.batch=function(t){var e="number"==typeof t?new f(Math.round(Math.abs(t))):t&&t.schedule?t:new f(1),r=this._clone();return r._request=new s(r,e),r},k.prototype.unbatch=function(){var t=this._clone();return t._request=new s(t,new h),t},k.prototype.treatErrorsAsValues=function(){return this._clone({_treatErrorsAsValues:!0})},k.prototype.asDataSource=function(){return new i(this)},k.prototype._materialize=function(){return this._clone({_materialized:!0})},k.prototype._dematerialize=function(){return this._clone({_materialized:"delete"})},k.prototype.boxValues=function(){return this._clone({_boxed:!0})},k.prototype.unboxValues=function(){return this._clone({_boxed:"delete"})},k.prototype.withoutDataSource=function(){return this._clone({_source:"delete"})},k.prototype.toJSON=function(){return{$type:"ref",value:this._path}},k.prototype.getPath=function(){return this._path?this._path.slice():this._path},k.prototype._fromWhenceYouCame=function(t){return this._clone({_allowFromWhenceYouCame:void 0===t||t})},k.prototype._getBoundValue=t(18),k.prototype._getVersion=t(23),k.prototype._getPathValuesAsPathMap=E.getWithPathsAsPathMap,k.prototype._getPathValuesAsJSONG=E.getWithPathsAsJSONGraph,k.prototype._setPathValues=t(69),k.prototype._setPathMaps=t(68),k.prototype._setJSONGs=t(67),k.prototype._setCache=t(68),k.prototype._invalidatePathValues=t(39),k.prototype._invalidatePathMaps=t(38)},{106:106,121:121,125:125,18:18,19:19,21:21,23:23,24:24,29:29,38:38,39:39,4:4,40:40,44:44,5:5,50:50,51:51,52:52,57:57,58:58,59:59,6:6,61:61,65:65,66:66,67:67,68:68,69:69,7:7,70:70,71:71,78:78,8:8,88:88,89:89,90:90,92:92}],4:[function(t,e,r){function n(t){this._model=t._materialize().treatErrorsAsValues()}n.prototype.get=function(t){return this._model.get.apply(this._model,t)._toJSONG()},n.prototype.set=function(t){return this._model.set(t)._toJSONG()},n.prototype.call=function(t,e,r,n){var o=[t,e,r];return Array.prototype.push.apply(o,n),this._model.call.apply(this._model,o)._toJSONG()},e.exports=n},{}],5:[function(t,e,r){var n=t(86),o=t(81);function i(t){var e=t||{};this.syncRefCount=0,this.expired=e.expired||[],this.unsafeMode=e.unsafeMode||!1,this.cache={},n(e.comparator)&&(this.comparator=e.comparator),n(e.errorSelector)&&(this.errorSelector=e.errorSelector),n(e.onChange)&&(this.onChange=e.onChange)}i.prototype.errorSelector=function(t,e){return e},i.prototype.comparator=function(t,e){return o(t,"value")&&o(e,"value")?t.value===e.value&&t.$type===e.$type&&t.$expires===e.$expires:t===e},e.exports=i},{81:81,86:86}],6:[function(t,e,r){e.exports=function(){var t=this._referenceContainer;return!this._allowFromWhenceYouCame||(!0===t||!1!==t&&((!t||void 0!==t.$_parent)&&(!t||!t.$_invalidated)))}},{}],7:[function(t,e,r){var c=t(10),f=t(20),h=t(111);e.exports=function(t){var e,r=t&&t.$__path,n=t&&t.$__refPath,o=t&&t.$__toReference;if(r){var i="e";if(o&&(i=!1,e=f(this,o),n&&e&&e.$type===h))for(var s=e.value,a=0,u=n.length,i=!0;i&&a<u;++a)s[a]!==n[a]&&(i=!1);return i?"e"===i&&(e=!0):e=!1,this._clone({_path:r,_referenceContainer:e})}throw new c}},{10:10,111:111,20:20}],8:[function(t,e,r){var i=t(125),s=t(18),a=t(11);e.exports=function(t){var e=i.fromPath(t);if(!Array.isArray(e))throw new Error("Model#derefSync must be called with an Array path.");var r=s(this,this._path.concat(e),!1),n=r.path,o=r.value;if(r.found&&void 0!==o){if(o.$type)throw new a(n,n);return this._clone({_path:n})}}},{11:11,125:125,18:18}],9:[function(t,e,r){function n(){var t=new Error("It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model.");return t.name="BoundJSONGraphModelError",Object.setPrototypeOf&&Object.setPrototypeOf(t,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(t,n),t}t(15)(n),e.exports=n},{15:15}],10:[function(t,e,r){function n(){var t=new Error("Deref can only be used with a non-primitive object from get, set, or call.");return t.name="InvalidDerefInputError",Object.setPrototypeOf&&Object.setPrototypeOf(t,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(t,n),t}t(15)(n),e.exports=n},{15:15}],11:[function(t,e,r){function n(t,e){var r=new Error("The boundPath of the model is not valid since a value or error was found before the path end.");return r.name="InvalidModelError",r.boundPath=t,r.shortedPath=e,Object.setPrototypeOf&&Object.setPrototypeOf(r,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(r,n),r}t(15)(n),e.exports=n},{15:15}],12:[function(t,e,r){function n(t){var e=new Error("An exception was thrown when making a request.");return e.name="InvalidSourceError",e.innerError=t,Object.setPrototypeOf&&Object.setPrototypeOf(e,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(e,n),e}t(15)(n),e.exports=n},{15:15}],13:[function(t,e,r){function n(t){var e=new Error("The allowed number of retries have been exceeded.");return e.name="MaxRetryExceededError",e.missingOptimizedPaths=t||[],Object.setPrototypeOf&&Object.setPrototypeOf(e,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(e,n),e}t(15)(n),n.is=function(t){return t&&"MaxRetryExceededError"===t.name},e.exports=n},{15:15}],14:[function(t,e,r){function n(){var t=new Error("`null` and `undefined` are not allowed in branch key positions");return t.name="NullInPathError",Object.setPrototypeOf&&Object.setPrototypeOf(t,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(t,n),t}t(15)(n),e.exports=n},{15:15}],15:[function(t,e,r){e.exports=function(t){t.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,Error):t.__proto__=Error}},{}],16:[function(t,e,r){var y=t(74),b=t(27),_=t(31),m=t(111),g=t(41);e.exports=function(t,e,r,n,o,i,s){for(var a,u=r,c=o,f=n,h=0;;){if(!(a=0===h&&f.$_context?(h=c.length,f.$_context):u[c[h++]])){u=void 0;break}var l=a.$type,p=l&&a.value||a;if(h<c.length){if(l){u=a;break}u=a}else{if(u=a,l&&_(a))break;if(f.$_context||y(f,a),l!==m)break;s?b(t,a,i,null,null,null,null,c,c.length,s):g(t._root,a),h=0,c=p,f=a,u=e}}if(h<c.length&&void 0!==u){for(var d=[],v=0;v<h;v++)d[v]=c[v];c=d}return[u,c,f]}},{111:111,27:27,31:31,41:41,74:74}],17:[function(t,e,r){var _=t(20),m=t(11),g=t(9);e.exports=function(y,b){return function(t,e,r){var n,o,i,s,a,u=b?r:[{}],c=u[0],f={values:u,optimizedPaths:[]},h=t._root.cache,l=t._path,p=h,d=[],v=[];if(l.length){if(b)return{criticalError:new g};if(o=(n=t._getOptimizedBoundPath()).length,(p=_(t,n))&&p.$type)return{criticalError:new m(l,n)};a=t._referenceContainer}else n=[],o=0;for(i=0,s=e.length;i<s;i++)y(t,h,p,e[i],0,c,f,v,d,n,o,b,!1,a);return function t(e,r){if(e!==r&&null!==e&&"object"==typeof e&&!e.$type&&null!==r&&"object"==typeof r&&!r.$type)for(var n in r){var o;"$__path"!==n&&(void 0===(o=e[n])?e[n]=r[n]:t(o,r[n]))}}(c,e.length?r[0]:b?{jsonGraph:{},paths:[]}:{json:{}}),f}}},{11:11,20:20,9:9}],18:[function(t,e,r){var f=t(22),h=t(11);e.exports=function(t,e,r){var n,o,i,s,a=e,u=e,c=t._boxed;for(r=t._materialized,n=t._treatErrorsAsValues,t._boxed=!0,t._materialized=void 0===r||r,t._treatErrorsAsValues=!0,o=f(t,a.concat(null),!0),t._boxed=c,t._materialized=r,t._treatErrorsAsValues=n,a=o.optimizedPath,i=o.shorted,s=o.found,o=o.value;a.length&&null===a[a.length-1];)a.pop();if(s&&i)throw new h(u,a);return{path:a,value:o,shorted:i,found:s}}},{11:11,22:22}],19:[function(t,e,r){var c=t(87);function f(t){for(var e,r={},n=Object.keys(t),o=0,i=n.length;o<i;o++)e=n[o],c(e)||(r[e]=t[e]);return r}e.exports=function(t){var e={};return function s(a,u,t){Object.keys(a).filter(function(t){return!c(t)&&void 0!==a[t]}).forEach(function(t){var e=a[t],r=u[t];if(r=r||(u[t]={}),e.$type){var n,o=e.value&&"object"==typeof e.value,i=!e.$_modelCreated;return n=o||i?f(e):e.value,void(u[t]=n)}s(e,r,t)})}(t,e),e}},{87:87}],20:[function(t,e,r){e.exports=function(t,e){for(var r=t._root.cache,n=-1,o=e.length;++n<o&&r&&!r.$type;)r=r[e[n]];return r}},{}],21:[function(t,e,r){var o=t(52),s=t(125);e.exports=function(t){for(var i=s.fromPath(t),e=0,r=i.length;++e<r;)if("object"==typeof i[e])return new o(function(t){t.onError(new Error("Paths must be simple paths"))});var n=this;return new o(function(o){return n.get(i).subscribe(function(t){for(var e=t.json,r=-1,n=i.length;e&&++r<n;)e=e[i[r]];o.onNext(e)},function(t){o.onError(t)},function(){o.onCompleted()})})}},{125:125,52:52}],22:[function(t,e,r){var m=t(16),g=t(30),x=t(31),w=t(41),O=t(111),S=t(109),E=t(110);e.exports=function(t,e,r){for(var n,o,i,s,a,u=t._root.cache,c=e.length,f=[],h=!1,l=!1,p=0,d=u,v=u,y=u,b=!0,_=!1;d&&p<c;){if(null!==(n=e[p++])&&(d=v[n],f[f.length]=n),!d){b=!(h=!(y=void 0));break}if((i=d.$type)===S&&void 0===d.value){y=void 0,b=!1,h=p<c;break}if(p<c){if(i===O){if(x(d)){_=!0,y=void 0;break}if(!(a=(s=m(t,u,u,d,d.value))[0])){d=y=void 0,b=!1;break}i=a.$type,d=a,f=s[1].slice(0)}if(i)break}else y=d;v=d}if(p<c&&!_){for(o=p;o<c;++o)if(null!==e[p]){l=!0;break}for(y=l?void(h=!0):d,o=p;o<c;++o)null!==e[o]&&(f[f.length]=e[o])}if(y&&i&&(x(y)?y=void 0:w(t._root,y)),y&&i===E&&!t._treatErrorsAsValues)throw{path:p===c?e:e.slice(0,p),value:y.value};return{value:y=y&&t._boxed?Boolean(i)&&!r?g(y):y:!y&&t._materialized?{$type:S}:y&&y.value,shorted:h,optimizedPath:f,found:b}}},{109:109,110:110,111:111,16:16,30:30,31:31,41:41}],23:[function(t,e,r){var o=t(22);e.exports=function(t,e){var r=o({_boxed:!0,_root:t._root,_treatErrorsAsValues:t._treatErrorsAsValues},e,!0).value,n=r&&r.$_version;return null==n?-1:n}},{22:22}],24:[function(t,e,r){var n=t(17),o=t(33),i=n(o,!1),s=n(o,!0);e.exports={getValueSync:t(22),getBoundValue:t(18),getWithPathsAsPathMap:i,getWithPathsAsJSONGraph:s}},{17:17,18:18,22:22,33:33}],25:[function(t,e,r){var s=t(41),a=t(30);e.exports=function(t,e,r,n,o){var i=e.value;o.errors||(o.errors=[]),t._boxed&&(i=a(e)),o.errors.push({path:n.slice(0,r),value:i}),s(t._root,e)}},{30:30,41:41}],26:[function(t,e,r){e.exports=function(t,e,r,n,o,i,s){var a;if(n.requestedMissingPaths||(n.requestedMissingPaths=[],n.optimizedMissingPaths=[]),r<e.length){for(var u=r;u<e.length;++u)if(function(t){if(null===t||"object"!=typeof t)return!1;var e=Array.isArray(t);{if(e&&t.length)return!1;if(e)return!0}var r=t.from,n=t.to;if(void 0===r||r<=n)return!1;return!0}(e[u]))return;a=e.slice(r)}else a=[];!function(t,e,r,n,o,i){var s=r.slice(0,e);Array.prototype.push.apply(s,t),i.requestedMissingPaths[i.requestedMissingPaths.length]=s;var a=n.slice(0,o);Array.prototype.push.apply(a,t),i.optimizedMissingPaths[i.optimizedMissingPaths.length]=a}(a,r,o,i,s,n)}},{}],27:[function(t,e,r){var S=t(41),E=t(30),P=t(111),k=t(109),$=t(110);e.exports=function(t,e,r,n,o,i,s,a,u,c){if(e&&S(t._root,e),r){var f,h,l,p,d,v,y,b,_,m=null,g=!1,x=e&&e.$type,w=e&&e.value;void 0===w&&(g=t._materialized),_=g?{$type:k}:t._boxed?E(e):c||x!==P?x===P||x===$?c?E(e):w:c?(y=w&&"object"==typeof w,b=!e||!e.$_modelCreated,y||b?E(e):w):e&&void 0===x&&void 0===w?{}:w:void 0;var O=!1;if(c){for((d=r.jsonGraph)||(O=!0,d=r.jsonGraph={},r.paths=[]),f=0,h=u-1;f<h;f++)d[p=a[f]]||(O=!0,d[p]={}),d=d[p];d[p=a[f]]=g?{$type:k}:_,s&&r.paths.push(s.slice(0,n))}else if(0===n)O=!0,r.json=_;else{for((d=r.json)||(O=!0,d=r.json={}),f=0;f<n-1;f++)d[l=s[f]]||(O=!0,d[l]=i[f]),d=(m=d)[v=l];l=s[f],void 0!==_&&(null!=l?(O=!0,d[l]||(d[l]=_)):m[v]=_)}o&&(o.hasValues=O)}}},{109:109,110:110,111:111,30:30,41:41}],28:[function(t,e,r){var d=t(31),v=t(110),y=t(25),b=t(27),_=t(26),m=t(32),g=t(76),x=t(75);e.exports=function(t,e,r,n,o,i,s,a,u,c,f,h){var l=e&&e.$type;if(!e||!l){var p=m(t);return!p&&f||b(t,e,o,n,i,s,a,u,c,f),void(p||_(t,r,n,i,a,u,c))}!d(e)||e.$_version===x.getVersion()&&0===e.$expires?l===v?(h&&(a[n]=null,n+=1),f||t._treatErrorsAsValues?b(t,e,o,n,i,s,a,u,c,f):(b(t,void 0,o,n,i,s,a,u,c,f),y(t,e,n,a,i))):(h&&(a[n]=null,n+=1),b(t,e,o,n,i,s,a,u,c,f)):(e.$_invalidated||g(e,t._root.expired,t._root),_(t,r,n,i,a,u,c))}},{110:110,25:25,26:26,27:27,31:31,32:32,75:75,76:76}],29:[function(t,e,r){var n=t(125),o=t(22);e.exports=function(t){var e=n.fromPath(t);if(!1===Array.isArray(e))throw new Error("Model#_getValueSync must be called with an Array path.");return this._path.length&&(e=this._path.concat(e)),this._syncCheck("getValueSync"),o(this,e).value}},{125:125,22:22}],30:[function(t,e,r){var n=t(35);e.exports=function(t){if(void 0===t)return t;var e={};for(var r in t)0!==r.lastIndexOf(n,0)&&(e[r]=t[r]);return e}},{35:35}],31:[function(t,e,r){e.exports=t(85)},{85:85}],32:[function(t,e,r){e.exports=function(t){return t._materialized&&!t._source}},{}],33:[function(t,e,r){var T=t(16),I=t(28),C=t(27),R=t(31),V=t(137).iterateKeySet,M=t(111),q=t(41);e.exports=function t(e,r,n,o,i,s,a,u,c,f,h,l,p,d){var v=p,y=f,b=d;if(n&&!n.$type&&i!==o.length){var _=o[i],m=!1,g=_;null!==_&&"object"==typeof _&&(g=V(_,m={}));var x,w,O,S,E,P,k,$,j=e._allowFromWhenceYouCame,A=h+1,N=i+1;do{null!=g?(v=!1,y[h]=g,P=y,k=A,(S=n[c[i]=g])&&(w=(x=S.$type)&&S.value||S,N<o.length&&x&&x===M&&!R(S)&&(q(e._root,S),l&&C(e,S,s,N,a,null,null,y,k,l),v=!0,S=(O=T(e,r,r,S,w,s,l))[0],E=O[1],b=O[2],P=E.slice(),k=E.length),S&&($=b&&j?{$__path:S.$_absolutePath,$__refPath:b.value,$__toReference:b.$_absolutePath}:{$__path:S.$_absolutePath},u[i]=$)),t(e,r,S,o,N,s,a,u,c,P,k,l,v,b),m&&!m.done&&(g=V(_,m))):(C(e,n,s,i,a,u,c,y,h,l),m&&!m.done&&(g=V(_,m)))}while(m&&!m.done)}else I(e,n,o,i,s,a,u,c,y,h,l,v)}},{111:111,137:137,16:16,27:27,28:28,31:31,41:41}],34:[function(t,e,r){"use strict";function n(t){return new n.Model(t)}n.keys=function(t){if(t)return Object.keys(t).filter(function(t){return"$__path"!==t})},(e.exports=n).Model=t(3)},{3:3}],35:[function(t,e,r){var n=t(37);e.exports=n+"_"},{37:37}],36:[function(t,e,r){e.exports=t(35)+"ref"},{35:35}],37:[function(t,e,r){e.exports="$"},{}],38:[function(t,e,r){var f=t(74),v=t(37),c=t(111),y=t(18),h=t(41),b=t(78),_=t(81),m=t(90),l=t(85),g=t(86),x=t(92),p=t(76),w=t(82),O=t(105),S=t(99);function E(t,e,r,n,o,i,s){for(var a=r.$type;a===c;){var u=function(t,e,r,n){if(l(e))return p(e,r,n),[void 0,t];h(n,e);var o=e,i=e.value,s=t;if(null!=(e=e.$_context))s=e.$_parent||t;else{var a=0,u=i.length-1,s=e=t;do{var c=E(t,s,e,i[a],a<u,r,n);if(e=c[0],x(e))return c;s=c[1]}while(a++<u);o.$_context!==e&&f(o,e)}return[e,s]}(t,r,i,s);if(r=u[0],x(r))return u;e=u[1],a=r&&r.$type}if(void 0!==a)return[r,e];if(null==n){if(o)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r.$_key)}else r=(e=r)[n];return[r,e]}e.exports=function(t,e){for(var r=t._root,n=r,o=r.expired,i=w(),s=t._path,a=r.cache,u=s.length?y(t,s).value:a,c=u.$_parent||a,f=a.$_version,h=-1,l=e.length;++h<l;){!function t(e,r,n,o,i,s,a){if(x(e)||e.$type)return;for(var u in e){var c,f,h,l,p;u[0]!==v&&_(e,u)&&(c=e[u],f=m(c)&&!c.$type,h=E(r,n,o,u,f,s,a),l=h[0],p=h[1],l&&(f?t(c,r,p,l,i,s,a):S(l,p,u,a)&&O(p,b(l),a,i)))}}(e[h].json,a,c,u,i,o,n)}var p=a.$_version,d=r.onChange;g(d)&&f!==p&&d()}},{105:105,111:111,18:18,37:37,41:41,74:74,76:76,78:78,81:81,82:82,85:85,86:86,90:90,92:92,99:99}],39:[function(t,e,r){var h=t(36),c=t(111),v=t(18),l=t(41),y=t(78),p=t(85),b=t(86),d=t(92),_=t(76),m=t(137).iterateKeySet,g=t(82),x=t(105),w=t(99);function O(t,e,r,n,o,i,s){for(var a=r.$type;a===c;){var u=function(t,e,r,n){if(p(e))return _(e,r,n),[void 0,t];l(n,e);var o=e,i=e.value,s=t;if(null!=(e=e.$_context))s=e.$_parent||t;else{var a,u=0,c=i.length-1,s=e=t;do{var f=O(t,s,e,i[u],u<c,r,n);if(e=f[0],d(e))return f;s=f[1]}while(u++<c);o.$_context!==e&&(a=e.$_refsLength||0,e.$_refsLength=a+1,(e[h+a]=o).$_context=e,o.$_refIndex=a)}return[e,s]}(t,r,i,s);if(r=u[0],d(r))return u;e=u[1],a=r.$type}if(void 0!==a)return[r,e];if(null==n){if(o)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r.$_key)}else r=(e=r)[n];return[r,e]}e.exports=function(t,e){for(var r=t._root,n=r,o=r.expired,i=g(),s=t._path,a=r.cache,u=s.length?v(t,s).value:a,c=u.$_parent||a,f=a.$_version,h=-1,l=e.length;++h<l;){!function t(e,r,n,o,i,s,a,u){var c={};var f=r<e.length-1;var h=e[r];var l=m(h,c);do{var p=O(n,o,i,l,f,a,u),d=p[0],v=p[1];d&&(f?t(e,r+1,n,v,d,s,a,u):w(d,v,l,u,void 0)&&x(v,y(d),u,s)),l=m(h,c)}while(!c.done)}(e[h],0,a,c,u,i,o,n)}var p=a.$_version,d=r.onChange;b(d)&&f!==p&&d()}},{105:105,111:111,137:137,18:18,36:36,41:41,76:76,78:78,82:82,85:85,86:86,92:92,99:99}],40:[function(t,e,r){var d=t(98),v=t(105);e.exports=function(t,e,r,n,o,i){var s=r,a=o;"number"!=typeof a&&(a=.75);var u,c,f="number"==typeof i,h=n*a;for(p=e.pop();p;)s-=c=p.$size||0,!0==f?v(p,c,t,i):(u=p.$_parent)&&d(p,u,p.$_key,t),p=e.pop();if(n<=s){for(var l=t.$_tail,p=l;h<=s&&p;)l=l.$_prev,s-=c=p.$size||0,!0==f&&v(p,c,t,i),p=l;null==(t.$_tail=t.$_prev=p)?t.$_head=t.$_next=void 0:p.$_next=void 0}}},{105:105,98:98}],41:[function(t,e,r){var i=t(112);e.exports=function(t,e){var r,n,o;e.$expires!==i&&((r=t.$_head)?r!==e&&(n=e.$_prev,(o=e.$_next)&&(o.$_prev=n),n&&(n.$_next=o),e.$_prev=void 0,(((t.$_head=e).$_next=r).$_prev=e)===t.$_tail&&(t.$_tail=n)):t.$_head=t.$_tail=e)}},{112:112}],42:[function(t,e,r){e.exports=function(t,e){var r=e.$_prev,n=e.$_next;n&&(n.$_prev=r),r&&(r.$_next=n),e.$_prev=e.$_next=void 0,e===t.$_head&&(t.$_head=n),e===t.$_tail&&(t.$_tail=r)}},{}],43:[function(t,e,r){function n(t,e,r){this.sent=!1,this.scheduled=!1,this.requestQueue=e,this.id=++o,this.type=i,this._scheduler=t,this._attemptCount=r,this._pathMap={},this._optimizedPaths=[],this._requestedPaths=[],this._callbacks=[],this._count=0,this._disposable=null,this._collapsed=null,this._disposed=!1}var u=t(46),a=t(47),l=t(82),p=t(75),o=0,i=t(45).GetRequest,d=t(67),v=t(69),y=t(110),b=[],_=t(12);function m(r,n){var o=!1;return function(){var t,e;o||r._disposed||(o=!0,r._callbacks[n]=null,r._optimizedPaths[n]=[],r._requestedPaths[n]=[],t=--r._count,e=r._disposable,0==t&&(e.unsubscribe?e.unsubscribe():e.dispose(),r.requestQueue.removeRequest(r)))}}n.prototype={batch:function(t,e,r){var n,o,c=this,i=c._optimizedPaths,f=c._requestedPaths,h=c._callbacks,s=i.length;return i[s]=e,f[s]=t,h[s]=r,++c._count,c.scheduled||(c.scheduled=!0,o=c._scheduler.schedule(function(){n=a(c,i,function(t,e){var r,n,o,i=c.requestQueue.model;if(c.requestQueue.removeRequest(c),c._disposed=!0,i._treatDataSourceErrorsAsJSONGraphErrors?t instanceof _:t)for(r=0,o=h.length;r<o;++r)(n=h[r])&&n(t);else if(c._count){var s=l.getCurrentVersion();p.setVersion(s);var a={hasInvalidatedResult:!1},u=i._useServerPaths&&e&&void 0===e.paths?new Error("Server responses must include a 'paths' field when Model._useServerPaths === true"):void 0;for(u||c._merge(f,t,e,a),r=0,o=h.length;r<o;++r)(n=h[r])&&n(u||t,e,a.hasInvalidatedResult);p.setVersion(null)}}),c._disposable=n}),c._disposable=n||o),m(c,s)},add:function(t,e,r){var n,o=this,i=u(t,e,o._pathMap),s=!1,a=!1;return i.intersection.length&&(s=!0,n=o._callbacks.length,o._callbacks[n]=r,o._requestedPaths[n]=i.intersection,o._optimizedPaths[n]=[],++o._count,a=m(o,n)),[s,i.requestedComplement,i.optimizedComplement,a]},_merge:function(t,e,r,n){var o=this.requestQueue.model,i=o._root,s=i.errorSelector,a=i.comparator,u=o._path;o._path=b;var c,f,h=o._useServerPaths?r.paths:function(t){for(var e=[],r=-1,n=0,o=t.length;n<o;++n)for(var i=t[n],s=0,a=i.length;s<a;++s)e[++r]=i[s];return e}(t);e&&o._treatDataSourceErrorsAsJSONGraphErrors?((c=e)instanceof Error&&(c={message:c.message}),c.$type||(c={$type:y,value:c}),f=h.map(function(t){return{path:t,value:c}}),v(o,f,null,s,a,n)):d(o,[{paths:h,jsonGraph:r.jsonGraph}],null,s,a,n),o._path=u}},e.exports=n},{110:110,12:12,45:45,46:46,47:47,67:67,69:69,75:75,82:82}],44:[function(t,e,r){var y=t(45),n=t(48),b=t(43),o=t(137);function i(t,e){this.model=t,this.scheduler=e,this.requests=this._requests=[]}i.prototype={setScheduler:function(t){this.scheduler=t},set:function(t,e,r){return this.model._enablePathCollapse&&(t.paths=o.collapse(t.paths)),void 0===r&&(r=e,e=void 0),n(t,this.model,e,r)},get:function(t,e,r,n){var o,i,s,a,u=[],c=0,f=this._requests,h=e,l=t,p=!1;for(void 0===n&&(n=r,r=void 0),o=0,i=f.length;o<i;++o)if((s=f[o]).type===y.GetRequest){if(!s.sent){s.batch(l,h,v),l=h=null,++c;break}if(this.model._enableRequestDeduplication){var d=s.add(l,h,v);if(d[0]&&(l=d[1],h=d[2],u[u.length]=d[3],++c,!h.length))break}}function v(t,e,r){p||0===--c&&n(t,e,r)}return h&&h.length&&(s=new b(this.scheduler,this,r),f[f.length]=s,++c,a=s.batch(l,h,v),u[u.length]=a),function(){if(!p&&0!==c){p=!0;for(var t=u.length,e=0;e<t;++e)u[e]()}}},removeRequest:function(t){for(var e=this._requests,r=e.length;0<=--r;)if(e[r].id===t.id){e.splice(r,1);break}}},e.exports=i},{137:137,43:43,45:45,48:48}],45:[function(t,e,r){e.exports={GetRequest:"GET"}},{}],46:[function(t,e,r){var y=t(137).iterateKeySet;function f(t,e,r){for(var n=t.length-e.length,o=0;r&&o<-n;o++)r=r[e[o]];return r?0==n?b(t,e,r,0,[],[]):0<n?b(t,e,r,0,t.slice(0,n),[]):b(t,e,r,-n,[],e.slice(0,-n)):[[],[e],[t]]}function b(t,e,r,n,o,i){for(var s=t.length-e.length,a=[],u=[],c=[],f=e.length;n<f;++n){var h=e[n];if(h&&"object"==typeof h){for(var l={},p=y(h,l);!l.done;){var d,v=r[p];void 0===v?(c[c.length]=m(i,p,e,n+1),u[u.length]=m(o,p,t,n+1+s)):n===f-1?a[a.length]=g(o,p):(d=b(t,e,v,n+1,g(o,p),g(i,p)),Array.prototype.push.apply(a,d[0]),Array.prototype.push.apply(c,d[1]),Array.prototype.push.apply(u,d[2])),p=y(h,l)}break}if(r=r[h],i[i.length]=e[n],o[o.length]=t[n+s],void 0===r){c[c.length]=_(i,e,n+1),u[u.length]=_(o,t,n+s+1);break}n===f-1&&(a[a.length]=o)}return[a,c,u]}function _(t,e,r){var n=t.slice(),o=n.length,i=e.length-r;n.length=o+i;for(var s=0;s<i;++s)n[o+s]=e[r+s];return n}function m(t,e,r,n){var o=t.concat(e),i=o.length,s=r.length-n;o.length=i+s;for(var a=0;a<s;++a)o[i+a]=r[n+a];return o}function g(t,e){var r=t.slice();return r.push(e),r}e.exports=function(t,e,r){for(var n=[],o=[],i=[],s=0,a=e.length;s<a;++s){var u=e[s],c=f(t[s],u,r[u.length]);Array.prototype.push.apply(i,c[0]),Array.prototype.push.apply(n,c[1]),Array.prototype.push.apply(o,c[2])}return{intersection:i,optimizedComplement:n,requestedComplement:o}},e.exports.__test={findPartialIntersections:f}},{137:137}],47:[function(t,e,r){var n=t(137),g=n.toTree,x=n.toPaths,w=t(12);e.exports=function(t,e,r){if(0===t._count)return t.requestQueue.removeRequest(t),null;var n;t.sent=!0,t.scheduled=!1;var o,i,s=t.requestQueue.model;if(s._enablePathCollapse||s._enableRequestDeduplication){for(var a=t._pathMap,u=0,c=e.length;u<c;++u)for(var f=e[u],h=0,l=f.length;h<l;++h){var p,d=f[h],v=d.length;a[v]?(p=a[v])[p.length]=d:a[v]=[d]}for(var y=Object.keys(a),b=0,_=y.length;b<_;++b){var m=y[b];a[m]=g(a[m])}}n=s._enablePathCollapse?x(t._pathMap):1===e.length?e[0]:Array.prototype.concat.apply([],e);try{o=s._source.get(n,t._attemptCount)}catch(t){return r(new w),null}return o.subscribe(function(t){i=t},function(t){r(t,i)},function(){r(null,i)})}},{12:12,137:137}],48:[function(t,e,r){var l=t(67),p=t(69),d=t(12),v=[],y={dispose:function(){}};e.exports=function(t,r,e,n){var o,i,s=t.paths,a=r._root,u=a.errorSelector,c=a.comparator,f=r._path;try{i=r._source.set(t,e)}catch(t){return n(new d),y}var h=i.subscribe(function(t){var e;h&&h.disposed||(r._path=v,e=l(r,[{paths:s,jsonGraph:t.jsonGraph}],null,u,c),t.paths=e[1],r._path=f,o=t)},function(e){h&&h.disposed||(r._path=v,p(r,s.map(function(t){return{path:t,value:e}}),null,u,c),r._path=f,n(e))},function(){n(null,o)});return h}},{12:12,67:67,69:69}],49:[function(t,e,r){function n(t){this.disposed=!1,this.currentDisposable=t}n.prototype={dispose:function(){var t;!this.disposed&&this.currentDisposable&&(this.disposed=!0,(t=this.currentDisposable).dispose?t.dispose():t())}},e.exports=n},{}],50:[function(t,e,r){var n=t(52),f=t(12),i=t(125);function o(t,e,r,n,o){this.callPath=i.fromPath(e),this.args=r,o&&(this.paths=o.map(i.fromPath)),n&&(this.suffix=n.map(i.fromPath)),this.model=t}(o.prototype=Object.create(n.prototype))._subscribe=function(e){var r,t,n=this.callPath,o=this.args,i=this.suffix,s=this.paths,a=this.model,u=a._clone({_path:[]}),c=a._path.concat(n);if(a._source){try{t=a._source.call(c,o,i,s)}catch(t){return void e.onError(new f(t))}return t.subscribe(function(t){r=t},function(t){e.onError(t)},function(){var t=r.invalidated;t&&t.length&&u.invalidate.apply(u,t),u.withoutDataSource().set(r).subscribe(function(t){e.onNext(t)},function(t){e.onError(t)},function(){e.onCompleted()})})}e.onError(new Error("function does not exist"))},e.exports=o},{12:12,125:125,52:52}],51:[function(t,e,r){var c=Array.isArray,n=t(52),f=t(91),h=t(88),o={dispose:function(){}};function i(t,e){this._model=t;for(var r,n,o=[],i=-1,s=e.length;++i<s;){var a,u=e[i];if(c(u))a="PathValues";else if(f(u))a="PathValues";else{if(!h(u))throw new Error("Invalid Input");a="PathMaps"}n!==a&&(r={inputType:n=a,arguments:[]},o.push(r)),r.arguments.push(u)}this._groups=o}(i.prototype=Object.create(n.prototype)).progressively=function(){return this},i.prototype._toJSONG=function(){return this},i.prototype._subscribe=function(t){var n=this._model;return this._groups.forEach(function(t){var e=t.inputType,r=t.arguments;(0,n["_invalidate"+e])(n,r)}),t.onCompleted(),o},e.exports=i},{52:52,88:88,91:91}],52:[function(o,s,t){(function(r){var i=o(53),t=o(310).default,e=o(108);function n(t){this._subscribe=t}n.prototype[t]=function(){return e(this)},n.prototype._toJSONG=function(){return this},n.prototype.progressively=function(){return this},n.prototype.subscribe=n.prototype.forEach=function(t,e,r){var n=new i(t,e,r),o=this._subscribe(n);switch(typeof o){case"function":return{dispose:function(){n._closed||(n._closed=!0,o())}};case"object":return{dispose:function(){n._closed||(n._closed=!0,null!==o&&o.dispose())}};default:return{dispose:function(){n._closed=!0}}}},n.prototype.then=function(t,e){var i=this;return i._promise||(i._promise=new r(function(e,r){var n=!1,o=[];i.subscribe(function(t){o[o.length]=t},function(t){n=!0,r(t)},function(){var t=o;o.length<=1&&(t=o[0]),!1===n&&e(t)})})),i._promise.then(t,e)},s.exports=n}).call(this,"function"==typeof Promise?Promise:o(302))},{108:108,302:302,310:310,53:53}],53:[function(t,e,r){var n=t(95);function o(e,t,r){this._observer=e&&"object"==typeof e?{onNext:"function"==typeof e.onNext?function(t){e.onNext(t)}:n,onError:"function"==typeof e.onError?function(t){e.onError(t)}:n,onCompleted:"function"==typeof e.onCompleted?function(){e.onCompleted()}:n}:{onNext:"function"==typeof e?e:n,onError:"function"==typeof t?t:n,onCompleted:"function"==typeof r?r:n}}o.prototype={onNext:function(t){this._closed||this._observer.onNext(t)},onError:function(t){this._closed||(this._closed=!0,this._observer.onError(t))},onCompleted:function(){this._closed||(this._closed=!0,this._observer.onCompleted())}},e.exports=o},{95:95}],54:[function(t,e,r){function n(t,e,r,n,o){this.model=t,this.currentRemainingPaths=e,this.isJSONGraph=r||!1,this.isProgressive=n||!1,this.forceCollect=o||!1}var o=t(52),c=t(55),f=t(56),h={dispose:function(){}},l=t(40),p=t(78);(n.prototype=Object.create(o.prototype))._toJSONG=function(){return new n(this.model,this.currentRemainingPaths,!0,this.isProgressive,this.forceCollect)},n.prototype.progressively=function(){return new n(this.model,this.currentRemainingPaths,this.isJSONGraph,!0,this.forceCollect)},n.prototype._subscribe=function(t){var e,r,n,o=[],i=this.model,s=t.isJSONG=this.isJSONGraph,a=this.isProgressive,u=c(i,this.currentRemainingPaths,t,a,s,[{}],o);return u?f(this,i,u,t,o,1):(this.forceCollect&&(n=(r=(e=i._root).cache).$_version,l(e,e.expired,p(r),i._maxSize,i._collectRatio,n)),h)},e.exports=n},{40:40,52:52,55:55,56:56,78:78}],55:[function(t,e,r){var n=t(24),d=n.getWithPathsAsJSONGraph,v=n.getWithPathsAsPathMap;e.exports=function(t,e,r,n,o,i,s){var a=(o?d:v)(t,e,i),u=a.values&&a.values[0],c=!a.requestedMissingPaths||!a.requestedMissingPaths.length||!t._source;if(a.errors)for(var f=a.errors,h=s.length,l=0,p=f.length;l<p;++l,++h)s[h]=f[l];return(n||c&&void 0!==u)&&r.onNext(u),a.criticalError?(r.onError(a.criticalError),null):c?(s.length?r.onError(s):r.onCompleted(),null):a}},{24:24}],56:[function(t,e,r){var _=t(55),a=t(13),m=t(40),g=t(78),u=t(49),x=t(12);e.exports=function c(f,h,l,p,d,v){if(v>h._maxRetries)return p.onError(new a(l.optimizedMissingPaths)),{dispose:function(){}};var t=h._request,y=l.requestedMissingPaths,e=l.optimizedMissingPaths,b=new u,r=[],n=h._path;if(n.length)for(var o=0,i=y.length;o<i;++o)r[o]=n.concat(y[o]);else r=y;var s=t.get(r,e,v,function(t,e,r){if(h._treatDataSourceErrorsAsJSONGraphErrors?t instanceof x:t)return l.hasValues&&p.onNext(l.values&&l.values[0]),void p.onError(t);var n,o,i,s,a=r?(n=f.currentRemainingPaths,[{}]):(n=y,l.values),u=_(h,n,p,f.isProgressive,f.isJSONGraph,a,d);u?b.currentDisposable=c(f,h,u,p,d,v+1):(s=(i=(o=h._root).cache).$_version,m(o,o.expired,g(i),h._maxSize,h._collectRatio,s))});return b.currentDisposable=s,b}},{12:12,13:13,40:40,49:49,55:55,78:78}],57:[function(t,e,r){var n=t(54);e.exports=function(t){return new n(this,t)}},{54:54}],58:[function(t,e,r){var n=t(125),o=t(52),i=t(59),s=t(106),a=t(54);e.exports=function(){var e=s(arguments,i,"get");if(!0!==e)return new o(function(t){t.onError(e)});var t=n.fromPathsOrPathValues(arguments);return new a(this,t)}},{106:106,125:125,52:52,54:54,59:59}],59:[function(t,e,r){e.exports={path:!0,pathSyntax:!0}},{}],60:[function(t,e,r){function n(t,e,r,n){this._model=t,this._isJSONGraph=r||!1,this._isProgressive=n||!1,this._initialArgs=e,this._value=[{}];for(var o,i,s=[],a=-1,u=e.length;++a<u;){var c,f=e[a];l(f)||"string"==typeof f?(f=h.fromPath(f),c="PathValues"):p(f)?(f.path=h.fromPath(f.path),c="PathValues"):d(f)?c="JSONGs":v(f)&&(c="PathMaps"),i!==c&&(o={inputType:i=c,arguments:[]},s.push(o)),o.arguments.push(f)}this._groups=s}var o=t(52),h=t(125),l=Array.isArray,p=t(91),d=t(89),v=t(88),i=t(63);(n.prototype=Object.create(o.prototype))._subscribe=function(t){var e=this._groups,r=this._model,n=this._isJSONGraph,o=this._isProgressive;return i(r,t,e,n,o,1)},n.prototype._toJSONG=function(){return new n(this._model,this._initialArgs,!0,this._isProgressive)},n.prototype.progressively=function(){return new n(this._model,this._initialArgs,this._isJSONGraph,!0)},e.exports=n},{125:125,52:52,63:63,88:88,89:89,91:91}],61:[function(t,e,r){var o=t(64),i=t(106),s=t(60),a=t(52);e.exports=function(){var e=i(arguments,o,"set");if(!0!==e)return new a(function(t){t.onError(e)});for(var t=-1,r=arguments.length,n=[];++t<r;)n[t]=arguments[t];return new s(this,n)}},{106:106,52:52,60:60,64:64}],62:[function(t,e,r){var l=t(72);function p(t){return t.path}function d(t){return t.paths}e.exports=function(t,e){for(var r=t._root.errorSelector,n=-1,o=e.length,i=[],s=[],a={requestedPaths:i,optimizedPaths:s};++n<o;){var u,c=e[n],f=c.inputType,h=c.arguments;0<h.length&&(u=(0,t["_set"+f])(t,h,null,r),s.push.apply(s,u[1]),"PathValues"===f?i.push.apply(i,h.map(p)):"JSONGs"===f?i.push.apply(i,l(h,d)):i.push.apply(i,u[0]))}return a}},{72:72}],63:[function(t,e,r){var m=[],g=t(49),i=t(54),x=t(62),w=t(24).getWithPathsAsPathMap,O=t(12),S=t(13);function E(t,e,r,n,o){return new i(t,r,n,o,!0).subscribe(e)}e.exports=function n(o,i,s,a,u,c){var f,t=x(o,s),h=t.optimizedPaths,l=t.requestedPaths;if(c>o._maxRetries)return i.onError(new S(h)),{dispose:function(){}};if(void 0===o._source)return E(o,i,l,a,u);if(u){var e=w(o,l,[{}]);if(e.criticalError)return i.onError(e.criticalError),null;i.onNext(e.values[0]),f=o._root.cache.$_version}var r,p,d,v,y=(p=h,d=(r=o)._path,v={},r._path=m,r._getPathValuesAsJSONG(r._materialize().withoutDataSource(),p,[v]),r._path=d,v),b=new g,_=o._request.set(y,c,function(t,e){if(t instanceof O)i.onError(t);else{var r=!1;if(!t&&h.length!==e.paths.length||(r=!0),u)if(!(o._root.cache.$_version!==f))return void i.onCompleted();r?b.currentDisposable=E(o,i,l,a,u):n(o,i,s,a,u,c+1)}});return b.currentDisposable=_,b}},{12:12,13:13,24:24,49:49,54:54,62:62}],64:[function(t,e,r){e.exports={pathValue:!0,pathSyntax:!0,json:!0,jsonGraph:!0}},{}],65:[function(t,e,r){var n={dispose:function(){}};function o(){}o.prototype.schedule=function(t){return t(),n},o.prototype.scheduleWithState=function(t,e){return e(this,t),n},e.exports=o},{}],66:[function(t,e,r){function n(t){this.delay=t}function o(t){this.id=t,this.disposed=!1}n.prototype.schedule=function(t){var e=setTimeout(t,this.delay);return new o(e)},n.prototype.scheduleWithState=function(t,e){var r=this,n=setTimeout(function(){e(r,t)},this.delay);return new o(n)},o.prototype.dispose=function(){this.disposed||(clearTimeout(this.id),this.disposed=!0)},e.exports=n},{}],67:[function(t,e,r){var x=t(74),_=t(111),w=t(84),E=t(86),O=t(92),S=t(76),k=t(137).iterateKeySet,P=t(82),m=t(93),g=t(14);e.exports=function(t,e,r,n,o,i){for(var s=t._root,a=s,u=s.expired,c=P(),f=s.cache,h=f.$_version,l=[],p=[],d=[],v=[],y=-1,b=e.length;++y<b;)for(var _=e[y],m=_.paths,g=_.jsonGraph,x=-1,w=m.length;++x<w;){(function t(e,r,n,o,i,s,a,u,c,f,h,l,p,d,v,y,b,_){var m={};var g=r<e.length-1;var x=e[r];var w=k(x,m);var O=l.index;for(;;){h.depth=r;var S=j(n,o,i,s,a,u,w,g,h,l,p,d,v,y,b,_);h[r]=w,h.index=r,l[l.index++]=w;var E=S[0],P=S[1];if(E&&(g?t(e,r+1,n,P,E,s,S[3],S[2],c,f,h,l,p,d,v,y,b,_):(c.push(h.slice(0,h.index+1)),f.push(l.slice(0,l.index)))),w=k(x,m),m.done)break;l.index=O}})(m[x],p.index=0,f,f,f,g,g,g,d,v,l,p,c,u,a,o,n,i)}var O=f.$_version,S=s.onChange;return E(S)&&h!==O&&S(),[d,v]};var $=new Array(4);function j(t,e,r,n,o,i,s,a,u,c,f,h,l,p,d,v){for(var y=r.$type;y===_;){var b=function(t,e,r,n,o,i,s,a,u,c,f,h){var l=e.value;if(i.length=0,i.push.apply(i,l),w(e))return i.index=l.length,S(e,a,u),$[0]=void 0,$[1]=t,$[2]=n,$[3]=r,$;var p=0,d=e,v=l.length-1,y=e=t,b=n=r;do{var _=l[p],m=p<v;i.index=p;var g=j(t,y,e,r,b,n,_,m,o,i,s,a,u,c,f,h);if(e=g[0],O(e))return i.index=p,g;y=g[1],n=g[2],b=g[3]}while(p++<v);return i.index=p,d.$_context!==e&&x(d,e),$[0]=e,$[1]=y,$[2]=n,$[3]=b,$}(t,r,n,i,u,c,f,h,l,p,d,v);if(r=b[0],O(r))return b;e=b[1],i=b[2],o=b[3],y=r.$type}if(void 0!==y)return $[0]=r,$[1]=e,$[2]=i,$[3]=o,$;if(null==s){if(a)throw new g;r&&(s=r.$_key)}else o=i,r=(e=r)[s],i=o&&o[s];return r=m(e,r,i,s,u,c,f,h,l,p,d,v),$[0]=r,$[1]=e,$[2]=i,$[3]=o,$}},{111:111,137:137,14:14,74:74,76:76,82:82,84:84,86:86,92:92,93:93}],68:[function(t,e,r){var y=t(74),o=t(37),b=t(111),S=t(18),i=Array.isArray,s=t(81),E=t(90),_=t(85),P=t(86),m=t(92),g=t(76),k=t(82),x=t(94),w=t(14);function $(t,e,r,n,o,i,s,a,u,c,f,h,l,p){for(var d=r.$type;d===b;){var v=function(t,e,r,n,o,i,s,a,u,c){var f=r.value;if(o.length=0,o.push.apply(o,f),_(r))return o.index=f.length,g(r,s,a),[void 0,e];var h=r,l=e;if(null!=(r=r.$_context))l=r.$_parent||e,o.index=f.length;else{var p=0,d=f.length-1;o.index=p,l=r=e;do{var v=$(e,l,r,f[p],t,p<d,!0,n,o,i,s,a,u,c);if(r=v[0],m(r))return o.index=p,v;l=v[1]}while(p++<d);o.index=p,h.$_context!==r&&y(h,r)}return[r,l]}(o,t,r,a,u,c,f,h,l,p);if(r=v[0],m(r))return v;e=v[1],d=r&&r.$type}if(void 0!==d)return[r,e];if(null==n){if(i)throw new w;r&&(n=r.$_key)}else r=(e=r)[n];return[r=x(e,r,n,o,i,s,a,u,c,f,h,l,p),e]}function j(t){if(E(t)&&!t.$type){var e=[],r=0;for(var n in i(t)&&(e[r++]="length"),t)n[0]!==o&&s(t,n)&&(e[r++]=n);return e}}e.exports=function(t,e,r,n,o){for(var i=t._root,s=i,a=i.expired,u=k(),c=t._path,f=i.cache,h=c.length?S(t,c).value:f,l=h.$_parent||f,p=f.$_version,d=[],v=[],y=[],b=c.length,_=-1,m=e.length;++_<m;){var g=e[_],x=c.slice(0);x.index=b,function t(e,r,n,o,i,s,a,u,c,f,h,l,p,d){var v=j(e);if(v&&v.length)for(var y=0,b=v.length,_=c.index;;){var m=v[y],g=e[m],x=E(g)&&!g.$type;u.depth=r;var w=$(n,o,i,m,g,x,!1,u,c,f,h,l,p,d);u[r]=m,u.index=r,c[c.index++]=m;var O=w[0],S=w[1];if(O&&(x?t(g,r+1,n,S,O,s,a,u,c,f,h,l,p,d):(s.push(u.slice(0,u.index+1)),a.push(c.slice(0,c.index)))),++y>=b)break;c.index=_}}(g.json,0,f,l,h,v,y,d,x,u,a,s,o,n)}var w=f.$_version,O=i.onChange;return P(O)&&p!==w&&O(),[v,y]}},{111:111,14:14,18:18,37:37,74:74,76:76,81:81,82:82,85:85,86:86,90:90,92:92,94:94}],69:[function(t,e,r){var m=t(74),b=t(111),P=t(18),g=t(85),k=t(86),x=t(92),w=t(76),$=t(137).iterateKeySet,j=t(82),_=t(94),O=t(14);function A(t,e,r,n,o,i,s,a,u,c,f,h,l,p,d){for(var v=r.$type;v===b;){var y=function(t,e,r,n,o,i,s,a,u,c,f){var h=r.value;if(o.length=0,o.push.apply(o,h),g(r))return o.index=h.length,w(r,s,a),[void 0,e];var l=r,p=e;if(null!=(r=r.$_context))p=r.$_parent||e,o.index=h.length;else{var d=0,v=h.length-1,p=r=e;do{var y=h[d],b=d<v;o.index=d;var _=A(e,p,r,y,t,b,!0,n,o,i,s,a,u,c,f);if(r=_[0],x(r))return o.index=d,_;p=_[1]}while(d++<v);o.index=d,l.$_context!==r&&m(l,r)}return[r,p]}(o,t,r,a,u,c,f,h,l,p,d);if(r=y[0],x(r))return y;e=y[1],v=r.$type}if(i&&void 0!==v)return[r,e];if(null==n){if(i)throw new O;r&&(n=r.$_key)}else r=(e=r)[n];return[r=_(e,r,n,o,i,s,a,u,c,f,h,l,p,d),e]}e.exports=function(t,e,r,n,o){for(var i=t._root,s=i,a=i.expired,u=j(),c=t._path,f=i.cache,h=c.length?P(t,c).value:f,l=h.$_parent||f,p=f.$_version,d=[],v=[],y=[],b=c.length,_=-1,m=e.length;++_<m;){var g=e[_],x=g.path,w=g.value,O=c.slice(0);O.index=b,function t(e,r,n,o,i,s,a,u,c,f,h,l,p,d,v,y){var b={};var _=n<r.length-1;var m=r[n];var g=$(m,b);var x=f.index;for(;;){c.depth=n;var w=A(o,i,s,g,e,_,!1,c,f,h,l,p,d,v,y);c[n]=g,c.index=n,f[f.index++]=g;var O=w[0],S=w[1];if(O&&(_?t(e,r,n+1,o,S,O,a,u,c,f,h,l,p,d,v):(a.push(c.slice(0,c.index+1)),u.push(f.slice(0,f.index)))),g=$(m,b),b.done)break;f.index=x}}(w,x,0,f,l,h,v,y,d,O,u,a,s,o,n)}var S=f.$_version,E=i.onChange;return k(E)&&p!==S&&E(),[v,y]}},{111:111,137:137,14:14,18:18,74:74,76:76,82:82,85:85,86:86,92:92,94:94}],70:[function(t,e,r){var a=t(121),u=t(52),c=t(91);e.exports=function(t,e){for(var r=c(t)?t:a.pathValue(t,e),n=0,i=r.path,o=i.length;++n<o;)if("object"==typeof i[n])return new u(function(t){t.onError(new Error("Paths must be simple paths"))});var s=this;return new u(function(o){return s.set(r).subscribe(function(t){for(var e=t.json,r=-1,n=i.length;e&&++r<n;)e=e[i[r]];o.onNext(e)},function(t){o.onError(t)},function(){o.onCompleted()})})}},{121:121,52:52,91:91}],71:[function(t,e,r){var u=t(125),c=t(91),f=t(69);e.exports=function(t,e,r,n){var o=u.fromPath(t),i=e,s=r,a=n,i=c(o)?(a=s,s=i,o):{path:o,value:i};if(!1===c(i))throw new Error("Model#setValueSync must be called with an Array path.");return"function"!=typeof s&&(s=this._root._errorSelector),"function"!=typeof a&&(a=this._root._comparator),this._syncCheck("setValueSync"),f(this,[i]),this._getValueSync(i.path)}},{125:125,69:69,91:91}],72:[function(t,e,r){e.exports=function(t,e){for(var r=-1,n=-1,o=t.length,i=[];++n<o;)for(var s=e(t[n],n,t),a=-1,u=s.length;++a<u;)i[++r]=s[a];return i}},{}],73:[function(t,e,r){var o=t(35),i=t(81),s=Array.isArray,a=t(90);e.exports=function(t){var e=t;if(a(e)){e=s(t)?[]:{};var r=t;for(var n in r)0!==n.lastIndexOf(o,0)&&i(r,n)&&(e[n]=r[n])}return e}},{35:35,81:81,90:90}],74:[function(t,e,r){var n=t(36);e.exports=function(t,e){var r=e.$_refsLength||0;e[n+r]=t,e.$_refsLength=r+1,t.$_refIndex=r,t.$_context=e}},{36:36}],75:[function(t,e,r){var n=null;r.setVersion=function(t){n=t},r.getVersion=function(){return n}},{}],76:[function(t,e,r){var n=t(42);e.exports=function(t,e,r){return t.$_invalidated||(t.$_invalidated=!0,e.push(t),n(r,t)),t}},{42:42}],77:[function(t,e,r){var n=t(90);e.exports=function(t){return n(t)&&t.$expires||void 0}},{90:90}],78:[function(t,e,r){var n=t(90);e.exports=function(t){return n(t)&&t.$size||0}},{90:90}],79:[function(t,e,r){var n=t(90);e.exports=function(t){return n(t)&&t.$timestamp||void 0}},{90:90}],80:[function(t,e,r){var n=t(90);e.exports=function(t,e){var r=n(t)&&t.$type||void 0;return e&&r?"branch":r}},{90:90}],81:[function(t,e,r){var n=t(90),o=Object.prototype.hasOwnProperty;e.exports=function(t,e){return n(t)&&o.call(t,e)}},{90:90}],82:[function(t,e,r){var n=1;e.exports=function(){return n++},e.exports.getCurrentVersion=function(){return n}},{}],83:[function(t,e,r){e.exports=function(t,e,r,n,o){return t.$_key=r,t.$_parent=e,void 0!==n&&(t.$_version=n),t.$_absolutePath||(Array.isArray(r)?(t.$_absolutePath=o.slice(0,o.index),Array.prototype.push.apply(t.$_absolutePath,r)):(t.$_absolutePath=o.slice(0,o.index),t.$_absolutePath.push(r))),e[r]=t}},{}],84:[function(t,e,r){var n=t(96),o=t(113),i=t(112);e.exports=function(t){var e=t.$expires;return null!=e&&e!==i&&e!==o&&e<n()}},{112:112,113:113,96:96}],85:[function(t,e,r){var n=t(96),o=t(113),i=t(112);e.exports=function(t){var e=t.$expires;return null!=e&&e!==i&&(e===o||e<n())}},{112:112,113:113,96:96}],86:[function(t,e,r){e.exports=function(t){return Boolean(t)&&"function"==typeof t}},{}],87:[function(t,e,r){var n=t(35);e.exports=function(t){return"$size"===t||0===t.lastIndexOf(n,0)}},{35:35}],88:[function(t,e,r){var n=t(90);e.exports=function(t){return n(t)&&"json"in t}},{90:90}],89:[function(t,e,r){var n=Array.isArray,o=t(90);e.exports=function(t){return o(t)&&n(t.paths)&&(o(t.jsonGraph)||o(t.jsong)||o(t.json)||o(t.values)||o(t.value))}},{90:90}],90:[function(t,e,r){e.exports=function(t){return null!==t&&"object"==typeof t}},{}],91:[function(t,e,r){var n=Array.isArray,o=t(90);e.exports=function(t){return o(t)&&(n(t.path)||"string"==typeof t.path)}},{90:90}],92:[function(t,e,r){e.exports=function(t){return null==t||"object"!=typeof t}},{}],93:[function(t,e,r){var x=t(111),w=t(110),O=t(78),S=t(79),E=t(90),P=t(85),k=t(86),$=t(107),j=t(83),A=t(76),N=t(100),T=t(105),I=t(97);e.exports=function(t,e,r,n,o,i,s,a,u,c,f,h){var l,p,d,v,y,b,_,m,g=e&&void 0!==e.value?e.value:e;if(g===r){if(null===r)return e=$(r,void 0,r),t=T(t,-e.$size,u,s),e=j(e,t,n,void 0,i);if(void 0===r)return r;if((v=E(e))&&null==(p=e.$type))return null==e.$_parent&&j(e,t,n,s,i),e}else(v=E(e))&&(p=e.$type);if(p!==x){if((y=E(r))&&(d=r.$type),v&&!p&&(null==r||y&&!d))return e}else{if(null==r)return P(e)?void A(e,a,u):e;if((y=E(r))&&(d=r.$type)===x)if(e===r){if(null!=e.$_parent)return e}else if(b=e.$timestamp,_=r.$timestamp,!P(e)&&!P(r)&&_<b)return}return p&&y&&!d?j(N(e,r,t,n,u,h),t,n,void 0,i):(d||!y?(d===w&&k(f)&&(d=(r=f(I(o,n),r)).$type||d),d&&e===r?null==e.$_parent&&(e=$(e,d,e.value),t=T(t,-e.$size,u,s),e=j(e,t,n,s,i)):(m=!0,(p&&!P(e)||!v)&&(m=S(r)<S(e)==!1)&&(p||d)&&k(c)&&(m=!c(g,r,i.slice(0,i.index))),m&&(r=$(r,d,d?r.value:r),l=O(e)-O(r),e=N(e,r,t,n,u,h),t=T(t,l,u,s),e=j(e,t,n,s,i))),P(e)&&A(e,a,u)):null==e&&(e=j({},t,n,void 0,i)),e)}},{100:100,105:105,107:107,110:110,111:111,76:76,78:78,79:79,83:83,85:85,86:86,90:90,97:97}],94:[function(t,e,r){var m=t(111),g=t(110),x=t(80),w=t(78),O=t(79),S=t(85),E=t(92),P=t(86),k=t(107),$=t(76),j=t(83),A=t(100),N=t(105),T=t(104),I=t(97);e.exports=function(t,e,r,n,o,i,s,a,u,c,f,h,l,p){var d,v,y,b,_=x(e,i);return o||i?(_&&S(e)&&(_="expired",$(e,c,f)),(_&&_!==m||E(e))&&(e=A(e,{},t,r,f,p),e=j(e,t,r,u,a),e=T(e,u))):(v=x(d=n),y=O(d)<O(e)==!1,(_||v)&&P(h)&&(y=!h(e,d,a.slice(0,a.index))),y&&(v===g&&P(l)&&(v=(d=l(I(s,r),d)).$type||v),d=k(d,v,v?d.value:d),b=w(e)-w(d),e=A(e,d,t,r,f,p),t=N(t,b,f,u),e=j(e,t,r,u,a))),e}},{100:100,104:104,105:105,107:107,110:110,111:111,76:76,78:78,79:79,80:80,83:83,85:85,86:86,92:92,97:97}],95:[function(t,e,r){e.exports=function(){}},{}],96:[function(t,e,r){e.exports=Date.now},{}],97:[function(t,e,r){e.exports=function(t,e){var r=t.slice(0,t.depth);return r[r.length]=e,r}},{}],98:[function(t,e,r){var i=t(111),s=t(42),a=t(90),u=t(102),c=t(103);e.exports=function(t,e,r,n){if(a(t)){var o=t.$type;return o&&(o===i&&c(t),s(n,t)),u(t),!(e[r]=t.$_parent=void 0)}return!1}},{102:102,103:103,111:111,42:42,90:90}],99:[function(t,e,r){var a=t(81),u=t(37),c=t(98);e.exports=function t(e,r,n,o,i){if(c(e,r,n,o)){if(void 0!==e.$type&&i&&e.$_absolutePath&&(i.hasInvalidatedResult=!0),null==e.$type)for(var s in e)s[0]!==u&&a(e,s)&&t(e[s],e,s,o,i);return!0}return!1}},{37:37,81:81,98:98}],100:[function(t,e,r){var s=t(90),a=t(101),u=t(99);e.exports=function(t,e,r,n,o,i){return t===e?t:(s(t)&&(a(t,e),u(t,r,n,o,i)),r[n]=e)}},{101:101,90:90,99:99}],101:[function(t,e,r){var s=t(36);e.exports=function(t,e){for(var r=t.$_refsLength||0,n=e.$_refsLength||0,o=-1;++o<r;){var i=t[s+o];void 0!==i&&((i.$_context=e)[s+(n+o)]=i,t[s+o]=void 0)}return e.$_refsLength=r+n,t.$_refsLength=void 0,e}},{36:36}],102:[function(t,e,r){var o=t(36);e.exports=function(t){for(var e=-1,r=t.$_refsLength||0;++e<r;){var n=t[o+e];null!=n&&(n.$_context=n.$_refIndex=t[o+e]=void 0)}return t.$_refsLength=void 0,t}},{36:36}],103:[function(t,e,r){var o=t(36);e.exports=function(t){var e=t.$_context;if(e){for(var r=(t.$_refIndex||0)-1,n=(e.$_refsLength||0)-1;++r<=n;)e[o+r]=e[o+(r+1)];e.$_refsLength=n,t.$_refIndex=t.$_context=e=void 0}retu